Convert Nominal LABEL to numerical

noah977
noah977 New Altair Community Member
edited November 5 in Community Q&A
Hi,

I want to train a REGRESSION SVM (nu-SVR) with a sparse data example.

I am able to create the sparse data file easily.  The "label" in this case is a numeric value since we're doing regression.

When I load in the data file RM automatically sets the label as a nominal type.  This then causes the SVM to produce an error since it needs a numeric label for its regression.

I've tried nominal2numeric, but it only seems to work for attributes NOT LABELS.

How can I force RM to treat the labels at numerical (They are number!)

Thanks!!!
Tagged:

Answers

  • land
    land New Altair Community Member
    Hi,
    Operators ignore special attributes by default. To work on special attributes use the AttributeSubsetPreprocessing Operator with checked "process_special_attributes". Second thing is, that you should use the NominalNumbers2Numerical instead of Nominal2Numerical, since this would not interpret the strings as numbers but creates new numerical values instead.

    This XML fragment should help, if you past it into your process:
       <operator name="AttributeSubsetPreprocessing" class="AttributeSubsetPreprocessing" expanded="yes">
            <parameter key="attribute_name_regex" value="label"/>
            <parameter key="condition_class" value="attribute_name_filter"/>
            <parameter key="process_special_attributes" value="true"/>
            <operator name="NominalNumbers2Numerical" class="NominalNumbers2Numerical">
            </operator>
        </operator>
    Greetings,
      Sebastian
  • noah977
    noah977 New Altair Community Member
    Sebastian,

    That worked perfectly!

    Thank You!!!!

    -Noah