I know how to run a Weka model, but I'd like to tune some parameters. How do I do that?

Thanks, a newb



Tutorial here


Taken from that site:

Lesson 13: Tune Algorithm Parameters To get the most out of a machine learning algorithm you must tune the parameters of the method to your problem.

You cannot know how to best do this before hand, therefore you must try out lots of different parameters.

The Weka Experiment Environment allows you to design controlled experiments to compare the results of different algorithm parameters and whether the differences are statistically significant.

In this lesson you are going to design an experiment to compare the parameters of the k-Nearest Neighbors algorithm.

Open the “Weka Chooser GUI”. Click the “Experimenter” button to open the “Weka Experiment Environment” Click the “New” button. Click the “Add new…” button in the “Datasets” pane and select “data/diabetes.arff”. Click the “Add new…” button in the “Algorithms” pane and add 3 copes of the “IBk” algorithm. Click each IBk algorithm in the list and click the “Edit selected…” button and change “KNN” to 1, 3, 5 for each of the 3 different algorithms. Click the “Run” tab and click the “Start” button. Click the “Analyse” tab and click the “Experiment” button and then the “Perform test” button. You just designed, executed and analyzed the results of a controlled experiment to compare algorithm parameters.

We can see that the results for large K values is better than the default of 1 and the difference is significant.

Explore changing other configuration properties of KNN and build confidence in developing experiments to tune machine learning algorithms.


Happy data scienc-ing!


Adding to @Bendich's answer:

In some cases, you can have Weka do the tuning work. kNN (IBk in Weka) is an example. If you set crossvalidate to True, it will check all potential values of k from 1 up to the KNN setting (12 in the image) enter image description here

To access this menu of settings, you select IBk (so it shows up to the right of Choose) then left click on the IBk line.

So, between our two answers you have two ways to "tweak". It's hard to be more specific without looking at a specific application.


Not the answer you're looking for? Browse other questions tagged or ask your own question.