Applying two Classifiers on the same data sequentially

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Applying two Classifiers on the same data sequentially

Edward Wiskers
Hi all, 

Sequentially, I need to apply NaiveBayes and then J48 classifiers on the same dataset (iris dataset here) using Weka KnowledgeFlow. Hence, I designed the flow (please see the attached file), but I'm not sure if this is the correct flow. However, here is the final result I had:


=== Evaluation result ===

Scheme: J48
Options: -C 0.25 -M 2
Relation: iris_set_1_of_1


Correctly Classified Instances          48               94.1176 %
Incorrectly Classified Instances         3                5.8824 %
Kappa statistic                          0.9113
Mean absolute error                      0.0638
Root mean squared error                  0.19  
Relative absolute error                 14.3221 %
Root relative squared error             40.1973 %
Total Number of Instances               51     

=== Detailed Accuracy By Class ===

                 TP Rate  FP Rate  Precision  Recall   F-Measure  MCC      ROC Area  PRC Area  Class
                 1.000    0.000    1.000      1.000    1.000      1.000    1.000     1.000     Iris-setosa
                 0.947    0.063    0.900      0.947    0.923      0.876    0.955     0.880     Iris-versicolor
                 0.882    0.029    0.938      0.882    0.909      0.867    0.952     0.883     Iris-virginica
Weighted Avg.    0.941    0.033    0.942      0.941    0.941      0.909    0.967     0.916     

=== Confusion Matrix ===

  a  b  c   <-- classified as
 15  0  0 |  a = Iris-setosa
  0 18  1 |  b = Iris-versicolor
  0  2 15 |  c = Iris-virginica


Is the proposed flow correct? If not, could you please suggest the correct flow to be used in this case?

Thanks. 
Edward

_______________________________________________
Wekalist mailing list
Send posts to: [hidden email]
List info and subscription status: https://list.waikato.ac.nz/mailman/listinfo/wekalist
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html

KnowledgeFlow-twoClassifiers.png (52K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Applying two Classifiers on the same data sequentially

Eibe Frank-3
Your flow is correct, assuming your aim is to implement Joao Gama's cascade generalization method.

You can get the same result in the Explorer by configuring the FilteredClassifier to use the AddClassification filter, and telling the AddClassification filter to add the classification. Here is the corresponding configuration string for your example that you can paste into the Explorer:

weka.classifiers.meta.FilteredClassifier -F "weka.filters.supervised.attribute.AddClassification -classification -W \"weka.classifiers.bayes.NaiveBayes \"" -W weka.classifiers.trees.J48 -- -C 0.25 -M 2

You could obviously also use the FilteredClassifier in this manner in the KnowledgeFlow.

FYI: an easy way to debug a KnowledgeFlow is to connect TextViewer components in appropriate places, e.g., to print the training and test sets, and to print the classifier.

Cheers,
Eibe

On Fri, Jan 6, 2017 at 5:34 PM, Edward Wiskers <[hidden email]> wrote:
Hi all, 

Sequentially, I need to apply NaiveBayes and then J48 classifiers on the same dataset (iris dataset here) using Weka KnowledgeFlow. Hence, I designed the flow (please see the attached file), but I'm not sure if this is the correct flow. However, here is the final result I had:


=== Evaluation result ===

Scheme: J48
Options: -C 0.25 -M 2
Relation: iris_set_1_of_1


Correctly Classified Instances          48               94.1176 %
Incorrectly Classified Instances         3                5.8824 %
Kappa statistic                          0.9113
Mean absolute error                      0.0638
Root mean squared error                  0.19  
Relative absolute error                 14.3221 %
Root relative squared error             40.1973 %
Total Number of Instances               51     

=== Detailed Accuracy By Class ===

                 TP Rate  FP Rate  Precision  Recall   F-Measure  MCC      ROC Area  PRC Area  Class
                 1.000    0.000    1.000      1.000    1.000      1.000    1.000     1.000     Iris-setosa
                 0.947    0.063    0.900      0.947    0.923      0.876    0.955     0.880     Iris-versicolor
                 0.882    0.029    0.938      0.882    0.909      0.867    0.952     0.883     Iris-virginica
Weighted Avg.    0.941    0.033    0.942      0.941    0.941      0.909    0.967     0.916     

=== Confusion Matrix ===

  a  b  c   <-- classified as
 15  0  0 |  a = Iris-setosa
  0 18  1 |  b = Iris-versicolor
  0  2 15 |  c = Iris-virginica


Is the proposed flow correct? If not, could you please suggest the correct flow to be used in this case?

Thanks. 
Edward

_______________________________________________
Wekalist mailing list
Send posts to: [hidden email]
List info and subscription status: https://list.waikato.ac.nz/mailman/listinfo/wekalist
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html



_______________________________________________
Wekalist mailing list
Send posts to: [hidden email]
List info and subscription status: https://list.waikato.ac.nz/mailman/listinfo/wekalist
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
Loading...