Prediction Range

laurablaurab Member Posts: 23 Maven
edited November 2018 in Help
Hi,

I am using the weka MLP and would like to stop negative predictions occuring.  Is there any way of limiting the prediction range or something so the the lowest prediction value is 0?  I am already removing null values from my training set.  The training set lower range for value is 0.

Thanks Laura

Answers

  • landland RapidMiner Certified Analyst, RapidMiner Certified Expert, Member Posts: 2,531 Unicorn
    Hi Laura,
    this will not be possible. But you could do a postprocessing step instead and setting all values smaller 0 to 0. Thats a possible solution for doing that:
    <operator name="Root" class="Process" expanded="yes">
        <operator name="ExampleSetGenerator" class="ExampleSetGenerator">
            <parameter key="attributes_lower_bound" value="-1.0"/>
            <parameter key="attributes_upper_bound" value="1.0"/>
            <parameter key="number_of_attributes" value="3"/>
            <parameter key="target_function" value="complicated function"/>
        </operator>
        <operator name="LinearRegression" class="LinearRegression">
            <parameter key="keep_example_set" value="true"/>
        </operator>
        <operator name="ModelApplier" class="ModelApplier">
        </operator>
        <operator name="ChangeAttributeName" class="ChangeAttributeName">
            <parameter key="new_name" value="prediction"/>
            <parameter key="old_name" value="prediction(label)"/>
        </operator>
        <operator name="AttributeConstruction" class="AttributeConstruction">
            <list key="function_descriptions">
              <parameter key="prediction_nonNegative" value="if (prediction &lt; 0, 0, prediction)"/>
            </list>
        </operator>
    </operator>
    Hope that will help you.

    Greetings,
      Sebastian
  • laurablaurab Member Posts: 23 Maven
    Hi Sebastian,

    Thanks alot for your reply, its really helpful.  I also have a another problem but it is not related to this issue so I will start a new thread.

    Cheers Laura
Sign In or Register to comment.