Decision tree path

PB941PB941 Member Posts: 6 Contributor I
edited November 2018 in Help
Hi, I'm new to the use of this tool and need someone to help me to clarify a question. The question is: have built a model using apprentice a decision tree in order to perform a series of forecasts. Is it possible to see which route or specific path that follows the model for such a forecast?

Sorry for the mistakes in the text and in the way of publishing, English is not my language and may not have found the right way to express myself.
Tagged:

Answers

  • JEdwardJEdward RapidMiner Certified Analyst, RapidMiner Certified Expert, Member Posts: 578 Unicorn
    Just so I understand correctly you are wanting something like the below?
    I've used Tree to Rules to separate the decision tree rules (this is personal choice) and then used Generate Attributes to show the Rule applied to each scored example. 
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <process version="6.5.002">
      <context>
        <input/>
        <output/>
        <macros/>
      </context>
      <operator activated="true" class="process" compatibility="6.5.002" expanded="true" name="Process">
        <process expanded="true">
          <operator activated="true" class="retrieve" compatibility="6.5.002" expanded="true" height="60" name="Retrieve Deals" width="90" x="45" y="75">
            <parameter key="repository_entry" value="//Samples/data/Deals"/>
          </operator>
          <operator activated="true" class="tree_to_rules" compatibility="6.5.002" expanded="true" height="76" name="Tree to Rules" width="90" x="179" y="30">
            <process expanded="true">
              <operator activated="true" class="parallel_decision_tree" compatibility="6.5.002" expanded="true" height="76" name="Decision Tree" width="90" x="112" y="120"/>
              <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="retrieve" compatibility="6.5.002" expanded="true" height="60" name="Retrieve Deals-Testset" width="90" x="112" y="345">
            <parameter key="repository_entry" value="//Samples/data/Deals-Testset"/>
          </operator>
          <operator activated="true" class="apply_model" compatibility="6.5.002" expanded="true" height="76" name="Apply Model" width="90" x="246" y="210">
            <list key="application_parameters"/>
          </operator>
          <operator activated="true" class="generate_attributes" compatibility="6.5.002" expanded="true" height="76" name="Generate Attributes" width="90" x="380" y="75">
            <list key="function_descriptions">
              <parameter key="Rule" value="MISSING_NOMINAL"/>
              <parameter key="Rule" value="if(missing(Rule),&#10;if(Age &gt; 31.500 &amp;&amp; Gender == &quot;female&quot;&#10;,&quot;if Age &gt; 31.500 and Gender = female then no&quot;,MISSING_NOMINAL)&#10;,Rule)"/>
              <parameter key="Rule" value="if(missing(Rule),&#13;&#10;if(Age &gt; 31.500 &amp;&amp; Gender == &quot;male&quot; &amp;&amp; [Payment Method] == &quot;cash&quot; &amp;&amp; Age &gt; 35.500 &#13;&#10;,&quot;if Age &gt; 31.500 and Gender = male and Payment Method = cash and Age &gt; 35.500 then no&quot;&#13;&#10;,MISSING_NOMINAL)&#13;&#10;,Rule)"/>
              <parameter key="Rule" value="if(missing(Rule),&#10;if(Age &gt; 31.500 &amp;&amp; Gender == &quot;male&quot; &amp;&amp; [Payment Method] == &quot;cash&quot; &amp;&amp; Age &lt;= 35.500 &#10;,&quot;if Age &gt; 31.500 and Gender = male and Payment Method = cash and Age ≤ 35.500 then yes&quot;&#10;,MISSING_NOMINAL)&#10;,Rule)"/>
              <parameter key="Rule" value="if(missing(Rule),&#10;if(Age &gt; 31.500 &amp;&amp; Gender == &quot;male&quot; &amp;&amp; [Payment Method] == &quot;cheque&quot; &amp;&amp; Age &gt; 35.500&#10;,&quot;if Age &gt; 31.500 and Gender = male and Payment Method = cheque and Age &gt; 35.500 then no&quot;&#10;,MISSING_NOMINAL)&#10;,Rule)"/>
            </list>
          </operator>
          <connect from_op="Retrieve Deals" from_port="output" to_op="Tree to Rules" to_port="training set"/>
          <connect from_op="Tree to Rules" from_port="model" to_op="Apply Model" to_port="model"/>
          <connect from_op="Retrieve Deals-Testset" from_port="output" to_op="Apply Model" to_port="unlabelled data"/>
          <connect from_op="Apply Model" from_port="labelled data" to_op="Generate Attributes" to_port="example set input"/>
          <connect from_op="Apply Model" from_port="model" to_port="result 2"/>
          <connect from_op="Generate Attributes" from_port="example set output" to_port="result 1"/>
          <portSpacing port="source_input 1" spacing="0"/>
          <portSpacing port="sink_result 1" spacing="0"/>
          <portSpacing port="sink_result 2" spacing="144"/>
          <portSpacing port="sink_result 3" spacing="0"/>
        </process>
      </operator>
    </process>
  • PB941PB941 Member Posts: 6 Contributor I
    Hello again. First of all I want to thank your attention and say that is a pleasure to contact you. As I mentioned I am new to using this tool and I have some doubts about the potential that it can offer me. With respect to the shaft of rules I understand perfectly: I use in conjunction with a decision tree to generate the model map. Now the model throws me an ERA and averaged performance, for example 66 percent, however there are some specific ways whose effectiveness is higher, say 91 percent. In a sample of 100 000 instances, say 1000 taking a certain path to achieve Ranking, ie show a precise and easily identifiable phenomenon and whose effectiveness is greater than the whole model. Now the question is this: when I want to rate an event may I RapidMiner throw the path being followed to determine the likelihood of it or have to be the one to identify this way comparing attribute by attribute and identify this route in the model? I do not know if I will have done understand. Please if you could help me I would appreciate it greatly.

    A greeting.
  • mschmitzmschmitz Administrator, Moderator, Employee, RapidMiner Certified Analyst, RapidMiner Certified Expert, University Professor Posts: 3,231 RM Data Scientist
    Hi,

    i would be very careful in doing this. Beginners often think, that they can change the model so it fits more to their needs. This somehow breaks the idea of predictive modelling and makes you very vulnerable for overtraining.

    In your case i would rather think about a better weighting for your examples together with a better performance measure.

    ~Martin


    - Head of Data Science Services at RapidMiner -
    Dortmund, Germany
Sign In or Register to comment.