Weka Output Class Predictions January 14, 2010
Posted by vyolian in weka.trackback
I’m building a predictive model that’s time-series related. I wanted to visualize the instances I predicted incorrectly on a time-series plot. The first step, however, is to get it into a format that R is happy with. Here’s how to add a “predicted” column to your training file.
BASIC (only need existing columns):
In the Weka explorer, under the classify tab, click “More Options”. Make sure the “Store predictions for visualization” is checked.
Click “Start” to build and run the model.
When finished, right-click the model name from the Result List. Click on “Visualize classifier errors.”
Click “Save” in that new window and the outputted file will have the new predicted column.
To convert the resulting ARFF file to CSV, do “java weka.core.converters.CSVSaver -i your.arff -o your.csv”
ADVANCED (need excluded columns):
Say you have extra columns for debugging that you need to exclude before you use it for training — think instance IDs or date markers. Here’s how you would do that.
In the Explorer GUI, go to the classify tab
Choose “FilteredClassifier” under the “meta” folder
Go inside the FilteredClassifier options and choose your base classifier (J48)
In “filter” option, remove “AllFilter” and add “Unsupervised -> Attribute -> Remove”.
In the “Remove” option, choose the attribute index that you want to remove. Then click Add.
You’re now ready to run your model. Follow the latter steps above in “BASIC” to go through visualization and save the arff with the predicted column.
Comments»
No comments yet — be the first.