Search code examples
javapythonmachine-learningweka

How can I use a test set with python-weka-wrapper?


I'm trying to integrate Weka into my Python code but can run only 10 fold cross-validation on the training set but I have to use a test set as well. Can anybody show me a simple example how to use a test set with python-weka-wrapper?


Solution

  • Crosd-validation is only used for collecting statistics from internally built models. If you actually want to make predictions yourself, you need to build the classifier yourself using its build_classifier method and then either use classify_instance or distribution_for_instance to make a prediction per Instance. See this example.