Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

CLASSIFICATION USING WEKA

Aim:

To implement a classifier using WEKA.

We will demonstrate the process of working with the Naive Bayes classifier in Weka to classify
data.

STEP 1: Initially, we have to load the required dataset in the weka tool using OPEN FILE option
from the ‘Pre Process’ TAB . Here we are selecting the ‘IRIS’ dataset to execute.After selecting
your DataSet click open.

Default data location: C:\Program Files\Weka-3-9-6\data

STEP 2: Now we have to go to the classify tab on the top left side and click on the choose button
and select the Naive Bayes algorithm in it.
STEP 3: Now to change the parameters click on the right side at the choose button, and we are
accepting the default values in this example.

STEP 4:In ‘Test Options’ Select Cross Validation and set the Folds value to 10.

Cross-validation: The use of cross-validation in Weka, specifically with the Naive Bayes classifier, is
to assess and validate the performance of the Naive Bayes model by repeatedly splitting the data into
training and testing subsets, then averaging the results. This helps to evaluate how well the Naive
Bayes model is expected to perform on new, unseen data while also reducing biases in the evaluation
process.
STEP 5:Click on ‘More Options’ to open ‘Classifier Evaluation Options’ and configure your output
evaluation settings.In this example we are using the default evaluation settings as shown in the figure.

STEP 6: To generate the model, we now click “Start.” When the model is done, the evaluation statistic
will appear in the right panel.
STEP 6: Click on the "Visualize" tab to access various graphical representations of your classifier's
performance.

OUTPUT:

You might also like