RapidMiner 9.7 is Now Available

Lots of amazing new improvements including true version control! Learn more about what's new here.


Applying model to dataset et getting output file

Jh_DoeJh_Doe Member Posts: 2 Contributor I
edited June 2019 in Help

Hi community, 


I'm using RM for a couple of weeks to solve a business case. 

I've used "Auto Model" to loop for the best model to use. 

The design view is well filled with the model template.


Now, how to apply the model in order to fill the predicted value to a fresh dataset according to the Designed process ? 




Best Answer

  • lionelderkrikorlionelderkrikor Posts: 1,068   Unicorn
    Solution Accepted

    Hi @Jh_Doe,


     - Drag and drop an Apply Model operator in the "Process view"

     - Connect your test dataset (unlabeled dataset) to the uni input port of Apply Model operator

     - Connect your model to the mod input port of Apply Model operator

     - Connect the output ports (mod and lab) of Apply Model operator to the res ports.


    Here a simplified example of process : 



    The XML file of the process : 

    <?xml version="1.0" encoding="UTF-8"?><process version="9.0.001">
    <operator activated="true" class="process" compatibility="9.0.001" expanded="true" name="Process">
    <process expanded="true">
    <operator activated="true" class="retrieve" compatibility="9.0.001" expanded="true" height="68" name="Retrieve Titanic Training" width="90" x="112" y="85">
    <parameter key="repository_entry" value="//Samples/data/Titanic Training"/>
    <operator activated="true" class="set_role" compatibility="9.0.001" expanded="true" height="82" name="Set Role" width="90" x="246" y="85">
    <parameter key="attribute_name" value="Survived"/>
    <parameter key="target_role" value="label"/>
    <list key="set_additional_roles"/>
    <operator activated="true" class="split_data" compatibility="9.0.001" expanded="true" height="103" name="Split Data" width="90" x="380" y="85">
    <enumeration key="partitions">
    <parameter key="ratio" value="0.8"/>
    <parameter key="ratio" value="0.2"/>
    <operator activated="true" class="concurrency:parallel_decision_tree" compatibility="9.0.001" expanded="true" height="103" name="Decision Tree" width="90" x="514" y="85"/>
    <operator activated="true" class="apply_model" compatibility="9.0.001" expanded="true" height="82" name="Apply Model" width="90" x="648" y="238">
    <list key="application_parameters"/>
    <operator activated="true" class="performance_classification" compatibility="9.0.001" expanded="true" height="82" name="Performance" width="90" x="782" y="238">
    <list key="class_weights"/>
    <operator activated="true" class="retrieve" compatibility="9.0.001" expanded="true" height="68" name="Retrieve Titanic Unlabeled" width="90" x="112" y="391">
    <parameter key="repository_entry" value="//Samples/data/Titanic Unlabeled"/>
    <operator activated="true" class="apply_model" compatibility="9.0.001" expanded="true" height="82" name="Apply Model (2)" width="90" x="648" y="391">
    <list key="application_parameters"/>
    <connect from_op="Retrieve Titanic Training" from_port="output" to_op="Set Role" to_port="example set input"/>
    <connect from_op="Set Role" from_port="example set output" to_op="Split Data" to_port="example set"/>
    <connect from_op="Split Data" from_port="partition 1" to_op="Decision Tree" to_port="training set"/>
    <connect from_op="Split Data" from_port="partition 2" to_op="Apply Model" to_port="unlabelled data"/>
    <connect from_op="Decision Tree" from_port="model" to_op="Apply Model" to_port="model"/>
    <connect from_op="Decision Tree" from_port="exampleSet" to_port="result 1"/>
    <connect from_op="Apply Model" from_port="labelled data" to_op="Performance" to_port="labelled data"/>
    <connect from_op="Apply Model" from_port="model" to_op="Apply Model (2)" to_port="model"/>
    <connect from_op="Performance" from_port="performance" to_port="result 2"/>
    <connect from_op="Performance" from_port="example set" to_port="result 3"/>
    <connect from_op="Retrieve Titanic Unlabeled" from_port="output" to_op="Apply Model (2)" to_port="unlabelled data"/>
    <connect from_op="Apply Model (2)" from_port="labelled data" to_port="result 4"/>
    <portSpacing port="source_input 1" spacing="0"/>
    <portSpacing port="sink_result 1" spacing="0"/>
    <portSpacing port="sink_result 2" spacing="0"/>
    <portSpacing port="sink_result 3" spacing="0"/>
    <portSpacing port="sink_result 4" spacing="0"/>
    <portSpacing port="sink_result 5" spacing="0"/>

    I hope it helps,






  • Jh_DoeJh_Doe Member Posts: 2 Contributor I

    Dear Lionel, 


    "I hope it helps"

    It works !


    I was close but hope to you, it's solve. 

    Thank you for your quick reply and your kindness. 



  • lionelderkrikorlionelderkrikor Moderator, RapidMiner Certified Analyst, Member Posts: 1,068   Unicorn



    You're welcome.

    Glad that it works !


    Good luck for your project.







Sign In or Register to comment.