How to use Weka for predicting results

30,608

If you want to know more about saving a trained classifier and loading it later to predict, please refer to the following.

With the assumption that you want to use the Weka GUI, you have to go through these two steps:

  1. First, use some pre-labelled data to train a classifier (use your fruit prices data). Make sure the data is in ARFF format. After training, save the model to your disk. More on this can be found here: https://waikato.github.io/weka-wiki/saving_and_loading_models/

  2. In the second step, you use the already trained model (done in step 1). Specifically, you have to load the model file (saved in step 1) and then use the 'supplied test set" option on the "Classifiers" tab. In the "supplied test set" option, select the un-labelled data. More on this can be found here: https://waikato.github.io/weka-wiki/making_predictions/

I would suggest first playing around with the ARFF data files that come with your Weka install (these ARFF files are basically sitting under your Weka install directory. In my case it is under: C:\Program Files\Weka-3-7\data).

Some more useful URLs:

  1. https://developer.ibm.com/technologies/analytics/articles/os-weka1/
  2. http://ortho.clmed.ncku.edu.tw/~emba/2006EMBA_MIS/3_16_2006/WekaIntro.pdf

Hope that helps.

Share:
30,608
Prabodha Dissanayake
Author by

Prabodha Dissanayake

Updated on July 05, 2022

Comments

  • Prabodha Dissanayake
    Prabodha Dissanayake almost 2 years

    I'm new to Weka and I'm confused with the tool. I have a data set about fruit prices and related attributes. I'm trying to predict the specific fruit price using the data set. Since I'm new to Weka, I couldn't figure out how to do this task. Please help me or guide me to a tutorial about how to do predictions, and what is the best method or algorithm for this task.