Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use Weka for predicting results

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.

like image 734
Prabodha Dissanayake Avatar asked Nov 17 '12 17:11

Prabodha Dissanayake


People also ask

Can WEKA be used for prediction?

Since WEKA allows models to be saved (as Java binary serialized objects), one can use those models again to perform predictions. Check out the article Making Predictions for more details.

How does WEKA calculate accuracy?

Accuracy is calculated as the total of two correct predictions (TP + TN) divided by the total number of data sets (P + N). The best accuracy is 1.0 and the worst is 0.0. Sensitivity is calculated as the number of correct positive predictions (TP) divided by the total number of positive (P).


1 Answers

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.

like image 62
alphaGeek Avatar answered Sep 21 '22 12:09

alphaGeek