Weka Experimenter 'Class attribute is not nominal' but data is processed from Explorer
Master System Design with Codemia
Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.
Introduction
This Weka error usually means the Experimenter is reading a dataset whose class attribute is still numeric, even if you already transformed it in Explorer. The important detail is that preprocessing in Explorer only affects the in-memory dataset until you save the filtered result or recreate the same transformation inside the experiment workflow.
Why Explorer and Experimenter Can Disagree
Explorer and Experimenter are separate parts of Weka. If you load data in Explorer, apply a filter, and then open the original file in Experimenter, the Experimenter does not automatically inherit Explorer's in-memory changes.
That is why this pattern is common:
- load data in Explorer
- convert the class to nominal
- see the data looking correct in Explorer
- load the original file in Experimenter
- get "Class attribute is not nominal"
The problem is not that Weka forgot your change. The problem is that the change was never saved into the dataset that Experimenter is actually using.
Classification Needs a Nominal Class
Many Weka classifiers expect a nominal class attribute because they are classification algorithms, not regression algorithms. If the class is numeric, Weka interprets the problem differently.
A tiny ARFF example makes this obvious:
Here, purchased is numeric. If this is meant to represent categories such as yes and no, many classification workflows in Experimenter will reject it until it is converted to a nominal attribute.
Convert the Class Properly
If the class is really categorical, convert it with NumericToNominal in Explorer and then save the processed dataset.
For example, after filtering, the ARFF should look more like:
That nominal declaration is what the classifier cares about. Seeing the values 0 and 1 is not enough by itself; the attribute type must also be nominal.
Save the Filtered Dataset
The safest workflow is:
- load the data in Explorer
- set the correct class index
- apply
NumericToNominalor another relevant filter - verify the class attribute type in the Preprocess tab
- save the filtered dataset to a new ARFF file
- load that new file in Experimenter
That ensures Experimenter receives the transformed data, not the original source file.
Use a Regression Algorithm if the Class Is Truly Numeric
Sometimes the error message is actually correct. If the class is a real numeric target, such as price, temperature, or score, then converting it to nominal would be wrong. In that case, the fix is not preprocessing. The fix is choosing a regression setup instead of a classification setup.
So the first question should always be:
- is the class truly categorical
- or is it a numeric quantity that should stay numeric
Do not convert a genuine regression target to nominal just to silence the error.
Verify the Class Index
Another easy mistake is that the wrong attribute is being treated as the class. In Weka, a dataset can contain both numeric and nominal attributes, and if the class index points to the wrong column, Experimenter may complain even though the intended target looks fine elsewhere in the data.
Before running the experiment, double-check:
- which attribute is marked as class
- what type that attribute actually has
- whether the saved ARFF file matches what Explorer showed
Common Pitfalls
The biggest mistake is assuming that Explorer preprocessing automatically carries into Experimenter. It does not unless the filtered dataset is saved and reused.
Another common issue is converting the visible values without checking the attribute type. A class that looks like 0 and 1 can still be numeric rather than nominal.
People also sometimes fix the class type but forget to set the correct class index in the dataset, so Experimenter is still reading the wrong column as the target.
Finally, do not force a numeric target into a nominal type if the problem is actually regression. The correct fix depends on whether the task is classification or regression.
Summary
- Experimenter uses the dataset file you load, not Explorer's unsaved in-memory state.
- Classification algorithms in Weka usually require the class attribute to be nominal.
- If you filter the class in Explorer, save the processed ARFF and load that file into Experimenter.
- Verify the class index before running the experiment.
- If the target is truly numeric, use a regression workflow instead of converting it to nominal.

