Hammad Hassan
Hammad Hassan

Reputation: 1222

Test example set attributes should be equal to OR Superset of Training example set Rapidminer SVM

I am new to Rapid Miner and using SVM Linear in it. My model is as:
enter image description here

I made Training Example set which consist of 3552 examples and just 2 attributes and I am doing nominal to numeric conversion, passing through SVM Linear model and then connecting model output in applying model. This is fine.

In Test Example set, I have 735 examples with 2 attributes and doing nominal to numeric conversion and then applying this converted Example set to Applying Model. At this stage I am getting an error when I run the process, which says that:

enter image description here

I searched a lot about this but did not get the right direction. I will be thankful for your help.

Upvotes: 0

Views: 909

Answers (1)

Andrew Chisholm
Andrew Chisholm

Reputation: 6567

The Nominal to Numeric operator will make new attributes whose names will be derived from the values of the input attributes. This happens when dummy encoding is used for the coding type parameter. If the test data contains different values when compared to the training data then the resulting attributes will be different.

To confirm this is the problem, set a breakpoint after the Nominal to Numeric operators and examine the attributes of each example set.

You can change how the operator works by setting the parameter to unique integers but this might not suit the problem you are trying to solve.

One possible way to solve it is to combine the two data sets then split them again. This has the effect of creating allowed levels for each nominal attribute even though the data may not have an example of the value. Each split can then be used with the Nominal to Numeric operator and it should create all the required attributes.

Upvotes: 2

Related Questions