Classifying With a Classification Tree

3.3. Classifying With a Classification Tree#

Consider the following test data:

Weight (kg)

Tail Length (cm)

Ear Length (cm)

Class

4

25

4

cat

3

3

7

rabbit

3.5

7

3

cat

27

22

7

dog

../../_images/animal_dataset_test.png

Let’s use our classification tree to predict the class of each animal.

../../_images/ctree_5.png

Weight (kg)

Tail Length (cm)

Ear Length (cm)

Actual Class

Predicted Class

4

25

4

cat

cat

3

3

7

rabbit

rabbit

3.5

7

3

cat

rabbit

27

22

7

dog

dog

We can see that our model correctly predicts 3 of the 4 test samples. This means the model accuracy is 75%