Lab 2- Classification
1. After importing the data, assign appropriate role and level to each of the attributes. What
was the role/level of all attributes that you have assigned (a screen shot is enough)?
2. Partition the data into: 50% Train, 0% Validation and 50% Test data. Create 5 Decision
Trees on this partitioned data. Set Maximum Branch (a), Maximum Depth (b) and Leaf Size (c)
to (a, b, c) respectively for the 5 trees as follows: (2, 2, 50); (3, 3, 10); (4, 5, 5); (10, 6, 2); and
(10, 10, 1). Set the assessment measure for all to Misclassification rate. Compare the
performance of these models (based on misclassification rate on train data and test data),
and explain why such a result (the ranking (order) of model performance) was obtained. In
addition show the process flow diagram. (Hint: Consider model complexity).
Misclassification Rate (rounded to 3 decimal places)
Decision tree Train Test
1 0.169 0.173
2 0.154 0.154
3 0.138 0.140
4 0.133 0.141
5 0.133 0.142
➢ Misclassification rate of decision trees ranked from lowest to highest on train data: 5 < 4 < 3 < 2 < 1
➢ Misclassification rate of decision trees ranked from lowest to highest on test data: 3 < 4 < 5 < 2 < 1
Decision trees 1 and 2 appear to underfit the data, while decision trees 4 and 5 appear to overfit the
data. As the models becomes more complex, the models become overfitted. Thus, the decision trees
with higher maximum branch and higher maximum depth seem to do better and have lower
misclassification rates for the train data. However, for the test data, Decision tree 3 appears to
perform the best and has the lowest misclassification error rate among the other models because it
is more balanced and robust.
1
1. After importing the data, assign appropriate role and level to each of the attributes. What
was the role/level of all attributes that you have assigned (a screen shot is enough)?
2. Partition the data into: 50% Train, 0% Validation and 50% Test data. Create 5 Decision
Trees on this partitioned data. Set Maximum Branch (a), Maximum Depth (b) and Leaf Size (c)
to (a, b, c) respectively for the 5 trees as follows: (2, 2, 50); (3, 3, 10); (4, 5, 5); (10, 6, 2); and
(10, 10, 1). Set the assessment measure for all to Misclassification rate. Compare the
performance of these models (based on misclassification rate on train data and test data),
and explain why such a result (the ranking (order) of model performance) was obtained. In
addition show the process flow diagram. (Hint: Consider model complexity).
Misclassification Rate (rounded to 3 decimal places)
Decision tree Train Test
1 0.169 0.173
2 0.154 0.154
3 0.138 0.140
4 0.133 0.141
5 0.133 0.142
➢ Misclassification rate of decision trees ranked from lowest to highest on train data: 5 < 4 < 3 < 2 < 1
➢ Misclassification rate of decision trees ranked from lowest to highest on test data: 3 < 4 < 5 < 2 < 1
Decision trees 1 and 2 appear to underfit the data, while decision trees 4 and 5 appear to overfit the
data. As the models becomes more complex, the models become overfitted. Thus, the decision trees
with higher maximum branch and higher maximum depth seem to do better and have lower
misclassification rates for the train data. However, for the test data, Decision tree 3 appears to
perform the best and has the lowest misclassification error rate among the other models because it
is more balanced and robust.
1