Problem with mapping nominal -

User: "andyknownasabu"
New Altair Community Member
Updated by Jocelyn
Dear all,

I'm still struggling with the feature evaluation processing chain also described in my post from yesterday:
<?xml version="1.0" encoding="US-ASCII"?>
<process version="4.3">

  <operator name="Root" class="Process" expanded="yes">
      <operator name="Data Source" class="ArffExampleSource">
          <parameter key="data_file"    value="all_subjects.arff"/>
          <parameter key="id_attribute" value="id"/>
          <parameter key="label_attribute"      value="label"/>
      </operator>
      <operator name="YAGGA2" class="YAGGA2" expanded="yes">
          <parameter key="use_diff"    value="true"/>
          <parameter key="use_max"      value="true"/>
          <parameter key="use_min"      value="true"/>
          <parameter key="use_sin"      value="false"/>
          <parameter key="use_square_roots"    value="true"/>
          <operator name="SimpleValidation" class="SimpleValidation" expanded="yes">
              <parameter key="create_complete_model"    value="true"/>
              <operator name="OperatorChain" class="OperatorChain" expanded="yes">
                  <operator name="Mapping" class="Mapping">
                  </operator>
                  <operator name="LibSVMLearner" class="LibSVMLearner" breakpoints="before">
                      <parameter key="calculate_confidences"    value="true"/>
                      <parameter key="svm_type" value="epsilon-SVR"/>
                  </operator>
              </operator>
              <operator name="Applier Chain" class="OperatorChain" expanded="yes">
                  <operator name="Test" class="ModelApplier">
                      <list key="application_parameters">
                      </list>
                      <parameter key="keep_model"      value="true"/>
                  </operator>
                  <operator name="ClassificationPerformance" class="ClassificationPerformance">
                      <parameter key="keep_example_set" value="true"/>
                      <parameter key="root_mean_squared_error"  value="true"/>
                      <parameter key="root_relative_squared_error"      value="true"/>
                      <parameter key="weighted_mean_precision"  value="true"/>
                      <parameter key="weighted_mean_recall"    value="true"/>
                  </operator>
              </operator>
          </operator>
          <operator name="ProcessLog" class="ProcessLog">
              <parameter key="filename" value="process_log.txt"/>
              <list key="log">
                <parameter key="Generation"    value="operator.YAGGA2.value.generation"/>
                <parameter key="Recall" value="operator.ClassificationPerformance.value.weighted_mean_recall"/>
                <parameter key="Precision"      value="operator.ClassificationPerformance.value.weighted_mean_precision"/>
              </list>
          </operator>
      </operator>
      <operator name="AttributeWeightsWriter" class="AttributeWeightsWriter">
          <parameter key="attribute_weights_file"      value="svm/attribute.wgt"/>
      </operator>
      <operator name="PerformanceWriter" class="PerformanceWriter">
          <parameter key="performance_file"    value="svm/performance.per"/>
      </operator>
      <operator name="AttributeConstructionsWriter" class="AttributeConstructionsWriter">
          <parameter key="attribute_constructions_file" value="svm/attribute.att"/>
      </operator>
  </operator>

</process>
With NaiveBayes or Decision Trees this scheme works fine (despite the error message, see my post from yesterday), however, with LibSVMLearner I run into a problem: This operator requires numerical attributes while ClassificationPerformance requires nominal ones. That's why I added this Mapping operator.

My questions are: 1) Is this the right way to solve this problem? and 2) How do I configure the Mapping operator to map my nominal labels to values 1..n?

Thanks a lot in advance!

Find more posts tagged with