Waikato / meka

Multi-label classifiers and evaluation procedures using the Weka machine learning framework.
http://waikato.github.io/meka/
GNU General Public License v3.0
200 stars 76 forks source link

Java example (e.g TrainTestSet.java...) execute classifier.buildClassifier twice. #48

Closed vutle closed 6 years ago

vutle commented 6 years ago

Inside some of the Java examples we called classifier.buildClassifier Inside Evaluation.evaluateModel(...) classifier.buildClassifier is called again.

If would be good in to flag the classifier that it has been built. Then inside the Evaluation.evaluateModel check that if classifier.isBuilt() and prevent rebuiding the classifier.

This way we can resuse the evaluationModel function to evaluate a saved model or passed in a prebuilt model just to evaluate.

Regards

fracpete commented 6 years ago

The classifier is only rebuilt if you pass in training and test set. If you use the overloaded method with just the test instances, then no training occurs:

public static Result evaluateModel(MultiXClassifier h, Instances D_test, String tal, String vop) throws Exception;
vutle commented 6 years ago

Thanks, I wanted to display the information about the saved model. So I have created an override function for that purpose.