Options

Beginner: Tree to rule

cristianocristiano Member Posts: 16 Contributor II
edited November 2018 in Help
Hi!
I'm a new user of RapidMiner and I'd like some help for exporting the Tree model rules in some formats.

I think "Tree to rule" is a good solution, but I dont know how to link it to my model and if it's the right solution....

Any suggestions would be really appreciated. ;)

Thanks again

C.

Answers

  • Options
    SebastianLohSebastianLoh Member Posts: 99 Contributor II
    Hi cristiano,

    you can export the model into xml which can further process:
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <process version="5.0">
      <context>
        <input/>
        <output/>
        <macros/>
      </context>
      <operator activated="true" class="process" compatibility="5.0.8" expanded="true" name="Process">
        <process expanded="true" height="296" width="547">
          <operator activated="true" class="retrieve" compatibility="5.0.8" expanded="true" height="60" name="Retrieve" width="90" x="45" y="75">
            <parameter key="repository_entry" value="//Samples/data/Iris"/>
          </operator>
          <operator activated="true" class="multiply" compatibility="5.0.8" expanded="true" height="76" name="Multiply" width="90" x="179" y="75"/>
          <operator activated="true" class="tree_to_rules" compatibility="5.0.8" expanded="true" height="76" name="Tree to Rules" width="90" x="313" y="75">
            <process expanded="true" height="510" width="847">
              <operator activated="true" class="decision_tree" compatibility="5.0.8" expanded="true" height="76" name="Decision Tree" width="90" x="313" y="30"/>
              <connect from_port="training set" to_op="Decision Tree" to_port="training set"/>
              <connect from_op="Decision Tree" from_port="model" to_port="model"/>
              <portSpacing port="source_training set" spacing="0"/>
              <portSpacing port="sink_model" spacing="0"/>
            </process>
          </operator>
          <operator activated="true" class="write_model" compatibility="5.0.8" expanded="true" height="60" name="Write Model" width="90" x="447" y="75">
            <parameter key="model_file" value="tree_model.xml"/>
            <parameter key="output_type" value="XML"/>
          </operator>
          <connect from_op="Retrieve" from_port="output" to_op="Multiply" to_port="input"/>
          <connect from_op="Multiply" from_port="output 1" to_op="Tree to Rules" to_port="training set"/>
          <connect from_op="Tree to Rules" from_port="model" to_op="Write Model" to_port="input"/>
          <connect from_op="Write Model" from_port="through" to_port="result 1"/>
          <portSpacing port="source_input 1" spacing="0"/>
          <portSpacing port="sink_result 1" spacing="0"/>
          <portSpacing port="sink_result 2" spacing="0"/>
        </process>
      </operator>
    </process>
    ciao Seabstian
Sign In or Register to comment.