The model shown by the Decison Tree Predictor is not the one computed by the Decision Tree Learner; the classes have been “swapped”, and the predictions are the opposite of the correct ones (KNIME v2.0.2.0020620). I tried with the well known “zoo” examples.
Why does the naive learner view show P(class=?/ attribute)? For Naive Bayes we need to multiply the likelihood P(attr/class) and the prior.
P(class/attr1, attr2,…attrn) = P(atttr1, att2, …attrn/ class)*P(class) / P(attr1,attr2,…attrn) =
(cond. indip hypotesys)
=P(attr1/class) * P(attr2/class)…*P(attrn/class) * P(class) / P(attr1,attr2,…attrn)
computing P(class/attr1) , P(class/attrn) is wrong, and is a common error of my students.
Regarding the decision tree problem, I have used the zoo dataset in KNIME 2.0.2. I trained a dec tree with the default settings on the whole dataset using the last column “type” (column type has been change to string) as target. The output of predictor looks fine, there are not classes swapped. Can you please post the actual settings you have used inside the learner and predictor node?
May I send you the project? Can you send me your email address to email@example.com? I used the default settings without changing anything.
thanks for the hint with the Naive Bayes node. The implementation is correct but the view has displayed the probabilities in the wrong order. The fix of the view will be available in the next release.