0

The decision tree J48 generated a tree structure as below.

J48 pruned tree

petalwidth <= 0.6: Iris-setosa (50.0)
petalwidth > 0.6
|   petalwidth <= 1.7
|   |   petallength <= 4.9: Iris-versicolor (48.0/1.0)
|   |   petallength > 4.9
|   |   |   petalwidth <= 1.5: Iris-virginica (3.0)
|   |   |   petalwidth > 1.5: Iris-versicolor (3.0/1.0)
|   petalwidth > 1.7: Iris-virginica (46.0/1.0)

But it fails to classify the data below. Do anyone knows what may go wrong?

Plot : weka.classifiers.trees.J48 (iris)
Instance: 98
      sepallength : 5.0
       sepalwidth : 3.5
      petallength : 1.6
       petalwidth : 0.6
prediction margin : -1.0
  predicted class : Iris-versicolor
            class : Iris-setosa
John
  • 63
  • 1
  • 1
  • 7
  • 1
    Did you perform 10-fold cross-validation? If yes, then the model that you are looking at is based on the full training data, not one of the 10 models built during CV. The plot data, from which the error stems, is based on predictions collected from the 10 models during evaluation. – fracpete Jun 30 '21 at 09:21
  • @fracpete, thanks you are right. – John Jul 01 '21 at 02:51

1 Answers1

1

As @fracpete commented, I am using cross-validation. What Weka show in the classifier output is the Classifier model which experiences a full training set, not the predictive model.

John
  • 63
  • 1
  • 1
  • 7