Expt7 ML2025 250306 143857
Expt7 ML2025 250306 143857
OUTPUT
PROGRAM To Implement a Decision Tree AND to DISPLAY IT
Number of Training samples
105
Number of Testing samples
45
Class of Testing Samples
[1 0 2 2 0 2 0 0 0 2 0 2 1 1 2 0 0 2 1 0 1 0 1 1 2 1 2 2 2 0 1 1 1 1 0 2 2
1 1 0 1 0 2 2 0]
|--- feature_2 <= 2.45
| |--- class: 0
|--- feature_2 > 2.45
| |--- feature_3 <= 1.70
| | |--- feature_2 <= 4.95
| | | |--- class: 1
| | |--- feature_2 > 4.95
| | | |--- feature_3 <= 1.55
| | | | |--- class: 2
| | | |--- feature_3 > 1.55
| | | | |--- class: 1
| |--- feature_3 > 1.70
| | |--- class: 2
OUTPUT
OUTPUT
Training Samples
Gender Height
585 2 183.343569
590 2 171.482107
740 2 188.868396
633 2 182.644465
515 2 178.841086
.. ... ...
336 1 136.035596
694 2 180.998702
449 2 176.484152
332 1 164.418790
299 1 186.458330
Assignment
1) Write a program to calculate the confusion matrix and classification report for the decision
tree
2) Implement a decision tree as a classifier using digits dataset