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

"Need help with decision tree"

chobochobo Member Posts: 4 Contributor I
edited June 2019 in Help
Hi, I can't seem to get the decision tree to work even though there are no errors when I hit run button. I have a simple csv file with  three columns, they are all text values.


In the design workspace I have a Read CSV file connected to a Set Role which is connected to the tree, but I can't see the tree view or get a result.


Thanks.

Tagged:

Answers

  • steffensteffen Member Posts: 347 Maven
    Hello Chobo

    Your description is rather unspecific. Please copy the process from the xml tab into this thread, best into the code-area ("#"-symbol). Then we have something to think about.

    regards,

    steffen
  • chobochobo Member Posts: 4 Contributor I
    Here you go Steffen. I hope this what you are asking for. Thanks!

    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <process version="5.0">
      <context>
        <input/>
        <output/>
        <macros/>
      </context>
      <operator activated="true" class="process" expanded="true" name="Process">
        <process expanded="true" height="280" width="547">
          <operator activated="true" class="read_csv" expanded="true" height="60" name="Read CSV" width="90" x="112" y="75">
            <parameter key="file_name" value="C:\Documents and Settings\chobo\Desktop\test.csv"/>
          </operator>
          <operator activated="true" class="set_role" expanded="true" height="76" name="Set Role" width="90" x="246" y="97">
            <parameter key="name" value="WinLoss"/>
            <parameter key="target_role" value="label"/>
          </operator>
          <operator activated="true" class="decision_tree" expanded="true" height="76" name="Decision Tree" width="90" x="380" y="120"/>
          <connect from_op="Read CSV" from_port="output" to_op="Set Role" to_port="example set input"/>
          <connect from_op="Set Role" from_port="example set output" to_op="Decision Tree" to_port="training set"/>
          <portSpacing port="source_input 1" spacing="0"/>
          <portSpacing port="sink_result 1" spacing="0"/>
        </process>
      </operator>
    </process>
  • SebastianLohSebastianLoh Member Posts: 99 Contributor II
    Hi chobo,

    it seems you simply forget to connect the model output out your DecisionTree operator to the results. Try this process:
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <process version="5.0">
      <context>
        <input/>
        <output/>
        <macros/>
      </context>
      <operator activated="true" class="process" expanded="true" name="Process">
        <process expanded="true" height="583" width="920">
          <operator activated="true" class="read_csv" expanded="true" height="60" name="Read CSV" width="90" x="112" y="210">
            <parameter key="file_name" value="C:\Documents and Settings\chobo\Desktop\test.csv"/>
          </operator>
          <operator activated="true" class="set_role" expanded="true" height="76" name="Set Role" width="90" x="313" y="165">
            <parameter key="name" value="WinLoss"/>
            <parameter key="target_role" value="label"/>
          </operator>
          <operator activated="true" class="decision_tree" expanded="true" height="76" name="Decision Tree" width="90" x="581" y="120"/>
          <connect from_op="Read CSV" from_port="output" to_op="Set Role" to_port="example set input"/>
          <connect from_op="Set Role" from_port="example set output" to_op="Decision Tree" to_port="training set"/>
          <connect from_op="Decision Tree" from_port="model" to_port="result 1"/>
          <connect from_op="Decision Tree" from_port="exampleSet" to_port="result 2"/>
          <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"/>
        </process>
      </operator>
    </process>
    Ciao Sebastian
  • chobochobo Member Posts: 4 Contributor I
    It works! Thanks for the help Sebastian.
Sign In or Register to comment.