2. Using the information from the plot and the fittedclassification tree, provide a classification into one of the sixfood categories for each one of the food items below.
Transcribed Image Text from this Question
Exercise 2 Data on nutritional values were collected for a sample of food items of a fast-food chain. According to their type, the food items are allocated into six categories: Bev – Beverages and fizzy drinks, Break – Food items served at breakfast, Coffee – Coffee-based drinks, Meat – Meat-based items (not served breakfast), Shakes – Shakes and smoothies, Sides Fries and sides. A classification tree was fitted to the data with the purpose of classifying the food items using the information on their nutritional values. Below a visual representation and the associated output (note that the node numbering of the tree does not match the node numbering in the output). Sugars 18.5 <18.5 2 Protein 7 Calories <0.5 20.5 <235 235 Carbohydrates Sugars 44,5 24.5 277 Sugars > 14.5 14.5 Node 3 (n = 14) Node 5 in = 90) Node 8. in 39) Nodo 10 in = 34) Node 12 (n = 12) Node 13 in 47) 0.8 0.6 0.4 Node 6 in 24) 1 0.8 0.6 0.4 0.8 0.6 0.4 0.2 0.8 0.6 0.8 0.6 0.4 0.2 0.8 0.6 0.4 0.8 0.6 – 0.4 0.2 1 PTT TUYT NO 10 un ## 樹掛掛#掛都掛點掛 ## ## ## – 260 共 ## ## node), split, n, loss, yval, (yprob) * denotes terminal node ## ## 1) root 260 165 Coffee (0.1 0.16 0.37 0.16 0.13 0.073) 在 ## 2) Sugars>=18.5 128 51 Coffee (0.13 0.016 0.6 0 0.24 0.0078) 4) Protein< 0.5 14 1 Bev (0.93 0.071 0 0 0)* 5) Protein>=0.5 114 38 Coffee (0.035 0.018 0.67 0 0.27 0.0088) 10) Carbohydrates< 77 90 20 Coffee (0.044 0.022 0.78 0 0.14 0.011). 11) Carbohydrates>=77 24 6 Shakes (OO 0.250 0.75 0)* 3) Sugars< 18.5 132 90 Meat (0.076 0.3 0.14 0.32 0.03 0.14) ## 6) Calories< 235 39 22 Coffee (0.26 0.026 0.44 0.026 0.077 0.18) ## 7) Calories>235 93 52 Meat (O 0.42 0.011 0.44 0.011 0.12) ## 14) Sugars< 4.5 34 10 Break (O 0.71 O 0.12 0 0.18) * 15) Sugars>=4.5 59 22 Meat (O 0.25 0.017 0.63 0.017 0.085) ## 30) Sugars>=14.5 12 2 Break (O 0.83 0.083 0.083 0 0) * ## 31) Sugars 14.5 47 11 Meat (0 0.11 O 0.77 0.021 0.11). ## ## it 1 DI u h 1. Using the information above, compute the classification error of the fitted tree for this dataset. 2. Using the information from the plot and the fitted classification tree, provide a classification into one of the six food categories for each one of the food items below. Protein Item Calories Total.Fat Cholesterol Sodium Carbohydrates Sugars A 290 4 5 160 58 32 B 430 21 50 1260 41 6 5 20 in 3. Compute the entropy impurity of the classification of two food items above.
(Visited 4 times, 1 visits today)