The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here

Saving predicted labels

jacoblylesjacoblyles Member Posts: 2 Contributor I
edited November 2018 in Help
I am using logistic regression with cross validation and I would like to save the predicted label probability and true label for each data point in the set at the end of the process. Is it possible to do this with rapidminer?

Edit: I figured out how to do this by using the XVPrediction operator. My code is below in case anyone runs into the same issue:
<operator name="Root" class="Process" expanded="yes">>
    <operator name="ExampleSource" class="ExampleSource">
        <parameter key="attributes" value="/home/user/rm_workspace/data.aml"/>
    </operator>
    <operator name="XVPrediction" class="XVPrediction" expanded="yes">
        <parameter key="number_of_validations" value="2"/>
        <operator name="LogisticRegression" class="LogisticRegression">
            <parameter key="keep_example_set" value="true"/>
            <parameter key="return_model_performance" value="true"/>
        </operator>
        <operator name="OperatorChain" class="OperatorChain" expanded="yes">
            <operator name="ModelApplier" class="ModelApplier">
                <parameter key="keep_model" value="true"/>
                <list key="application_parameters">
                </list>
            </operator>
        </operator>
    </operator>
    <operator name="ExcelExampleSetWriter" class="ExcelExampleSetWriter">
        <parameter key="excel_file" value="/home/user/rm_workspace/log.xls"/>
    </operator>
        </list>
    </operator>
</operator>

Answers

  • haddockhaddock Member Posts: 849 Maven
    Nay probs, as the model applier adds this stuff to the example set, all you have to do is write the examples out, like this.
    <operator name="Root" class="Process" expanded="yes">
        <operator name="ExampleSetGenerator" class="ExampleSetGenerator">
            <parameter key="target_function" value="polynomial classification"/>
        </operator>
        <operator name="XValidation" class="XValidation" expanded="yes">
            <operator name="KernelLogisticRegression" class="KernelLogisticRegression">
            </operator>
            <operator name="OperatorChain" class="OperatorChain" expanded="yes">
                <operator name="ModelApplier" class="ModelApplier">
                    <list key="application_parameters">
                    </list>
                </operator>
                <operator name="ClassificationPerformance" class="ClassificationPerformance">
                    <parameter key="keep_example_set" value="true"/>
                    <parameter key="accuracy" value="true"/>
                    <list key="class_weights">
                    </list>
                </operator>
                <operator name="ExampleSetWriter" class="ExampleSetWriter">
                    <parameter key="example_set_file" value="bla"/>
                    <parameter key="format" value="special_format"/>
                    <parameter key="special_format" value="$a"/>
                </operator>
            </operator>
        </operator>
    </operator>
    By the way, I couldn't get your code to parse.

Sign In or Register to comment.