How to change the nominal order of attribute values ​​in WEKA GUI?

I have 2 datasets for training and testing with weka. They both have the same number of attributes and the same data type for variables (numeric or nominal). But they are incompatible with each other, because the order of the nominal values ​​is different

ex - Training set

     Occupation
  1   Doctor     40%
  2   Engineer   40%
  3   Teacher    20%

   Test set

  1   Engineer     40%
  2   doctor       40%
  3   Teacher      20%

      

Thus, both sets are incompatible. My question is, how do I change this separate order of the values ​​to make them compatible?

+4


source to share


2 answers


It looks a bit like a data preprocessing problem. I am very curious how the training and testing results ended up like this!

If you want to change the nominal values, you can use RenameNominalValues to rename your data labels. One possible way is to apply this to your testing data:

RenameNominalValues ​​Sample



This solution assumes that you are dealing with the Nominal attribute, that this is your last attribute, and they are marked as shown in the valueReplacements field.

Otherwise, depending on the number of cases, you can manually edit the values ​​or use your favorite table to replace the values.

Hope it helps!

+1


source


Use "SwapValues" under unattended attribute>



0


source







All Articles