131k views
0 votes
Given a training data set Y: A B C Class 15 1 A C1 20 3 B C2 25 2 A C1 30 4 A C1 35 2 B C2 25 4 A C1 15 2 B C2 20 3 B C2 Find the best split point for decision tree for attribute A

1 Answer

2 votes

Answer:

Step-by-step explanation:

To find the best split point for attribute A in the given training data set, we need to consider the values of attribute A and their corresponding classes. First, let's sort the data set based on attribute A: 15 1 A C1 20 3 B C2 25 2 A C1 30 4 A C1 35 2 B C2 25 4 A C1 15 2 B C2 20 3 B C2 Next, we can calculate the average of adjacent attribute A values and their corresponding classes. We will consider each average as a potential split point. Average between (15, 20): (15+20)/2 = 17.5 Average between (20, 25): (20+25)/2 = 22.5 Average between (25, 30): (25+30)/2 = 27.5 Average between (30, 35): (30+35)/2 = 32.5 Now, we calculate the class distribution for each potential split point. For example, for the split point 17.5, we have: Class C1: 1 (from data point 15 1 A C1) Class C2: 0 For the split point 22.5, we have: Class C1: 0 Class C2: 1 (from data point 20 3 B C2) For the split point 27.5, we have: Class C1: 3 (from data points 25 2 A C1, 30 4 A C1, 25 4 A C1) Class C2: 0 For the split point 32.5, we have: Class C1: 1 (from data point 35 2 B C2) Class C2: 0 From these calculations, we can see that the best split point for attribute A is 27.5, as it gives the highest class distribution for C1. To summarize, the best split point for attribute A in the given training data set is 27.5.