-1

I have decision tree is learned already but now I want to use this decision tree to predicted a new data is don't known class

I have:

Tid :  1 2 3 4 5 6 7 8 9 10
Refund : Yes No No Yes No No Yes No No No
MaritalStatus : Single Maried Single Maried Divorced 
                           Maried Divorced Single Maried Single
TexableIncome : 125K 100K 70K 120K 95K 60K 220K 85K 
                               75K 90K
Cheat (this attribute is class) : No No No No Yes No No Yes 
                                                      No Yes

After I use this data in above for train decision tree I get a tree but after this I have data I don't know class I want to use tree I got to predict a class

Tid : 11 12 13 14 15
Attrib1 : No Yes Yes No No 
Attrib2 : Small Medium Large Small Large 
Attrib3 : 55k 80k 110k 95k 67k
Class :    ?    ?    ?   ?  ?  (I want to predict this by my first tree)
double-beep
  • 5,031
  • 17
  • 33
  • 41

1 Answers1

0

A decision tree model is trained on all available attributes of the training set. All decisions leading to a label (class) prediction are based on these specific attributes. Thus your pre-trained model can only be applied to example sets, that at least contain all attributes of the training set (be aware that attributes with a special role like ´id´ are ignored by the learning algorithm).

In your example, the model relies on Refund, MaritalStatus and TexableIncome (spelling?), but the second data set, for which you want to predict a label, has the attributes Attrib1, Attrib2 and Attrib3. Not even a simple rename would work, since the type of possible values differs between MaritalStatus: Divorced, Single, Maried (again, spelling?) and Attrib2: Small, Medium, Large.

Christian König
  • 3,437
  • 16
  • 28