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

Why decision node is not label variable ?

ozgeozyazarozgeozyazar Member Posts: 21 Maven
I am using decision tree for my classification problem. I decided to use tree to rule to clearly see the results. But realized that decision node is not my target varible. Is it normal or is something wrong ?
(Decision tree with cross validation additionally I decisiden parameters with optimization)
I will be really appreciated if somebody help me on this matter.

Bests,
Özge

Best Answer

Answers

  • varunm1varunm1 Member Posts: 1,207 Unicorn
    Hello @ozgeozyazar

    Can you provide XML code (View --> Show Panel --> XML). I tried to replicate using titanic dataset but was able to see my rules with the correct target variable. XML code below.

    <?xml version="1.0" encoding="UTF-8"?><process version="9.2.001">
    <context>
    <input/>
    <output/>
    <macros/>
    </context>
    <operator activated="true" class="process" compatibility="6.0.002" expanded="true" name="Process" origin="GENERATED_TUTORIAL">
    <parameter key="logverbosity" value="init"/>
    <parameter key="random_seed" value="2001"/>
    <parameter key="send_mail" value="never"/>
    <parameter key="notification_email" value=""/>
    <parameter key="process_duration_for_mail" value="30"/>
    <parameter key="encoding" value="SYSTEM"/>
    <process expanded="true">
    <operator activated="true" class="retrieve" compatibility="9.2.001" expanded="true" height="68" name="Retrieve Titanic Training" width="90" x="45" y="85">
    <parameter key="repository_entry" value="//Samples/data/Titanic Training"/>
    </operator>
    <operator activated="true" class="concurrency:cross_validation" compatibility="9.2.001" expanded="true" height="145" name="Cross Validation" width="90" x="380" y="34">
    <parameter key="split_on_batch_attribute" value="false"/>
    <parameter key="leave_one_out" value="false"/>
    <parameter key="number_of_folds" value="5"/>
    <parameter key="sampling_type" value="automatic"/>
    <parameter key="use_local_random_seed" value="false"/>
    <parameter key="local_random_seed" value="1992"/>
    <parameter key="enable_parallel_execution" value="true"/>
    <process expanded="true">
    <operator activated="true" class="tree_to_rules" compatibility="9.2.001" expanded="true" height="82" name="Tree to Rules" width="90" x="112" y="34">
    <process expanded="true">
    <operator activated="true" class="concurrency:parallel_decision_tree" compatibility="9.2.001" expanded="true" height="103" name="Decision Tree" width="90" x="179" y="85">
    <parameter key="criterion" value="gain_ratio"/>
    <parameter key="maximal_depth" value="10"/>
    <parameter key="apply_pruning" value="true"/>
    <parameter key="confidence" value="0.1"/>
    <parameter key="apply_prepruning" value="true"/>
    <parameter key="minimal_gain" value="0.01"/>
    <parameter key="minimal_leaf_size" value="2"/>
    <parameter key="minimal_size_for_split" value="4"/>
    <parameter key="number_of_prepruning_alternatives" value="3"/>
    </operator>
    <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>
    <connect from_port="training set" to_op="Tree to Rules" to_port="training set"/>
    <connect from_op="Tree to Rules" from_port="model" to_port="model"/>
    <portSpacing port="source_training set" spacing="0"/>
    <portSpacing port="sink_model" spacing="0"/>
    <portSpacing port="sink_through 1" spacing="0"/>
    </process>
    <process expanded="true">
    <operator activated="true" class="apply_model" compatibility="9.2.001" expanded="true" height="82" name="Apply Model" width="90" x="45" y="34">
    <list key="application_parameters"/>
    <parameter key="create_view" value="false"/>
    </operator>
    <operator activated="true" class="performance_classification" compatibility="9.2.001" expanded="true" height="82" name="Performance" width="90" x="179" y="34">
    <parameter key="main_criterion" value="first"/>
    <parameter key="accuracy" value="true"/>
    <parameter key="classification_error" value="false"/>
    <parameter key="kappa" value="true"/>
    <parameter key="weighted_mean_recall" value="false"/>
    <parameter key="weighted_mean_precision" value="false"/>
    <parameter key="spearman_rho" value="false"/>
    <parameter key="kendall_tau" value="false"/>
    <parameter key="absolute_error" value="false"/>
    <parameter key="relative_error" value="false"/>
    <parameter key="relative_error_lenient" value="false"/>
    <parameter key="relative_error_strict" value="false"/>
    <parameter key="normalized_absolute_error" value="false"/>
    <parameter key="root_mean_squared_error" value="true"/>
    <parameter key="root_relative_squared_error" value="false"/>
    <parameter key="squared_error" value="false"/>
    <parameter key="correlation" value="false"/>
    <parameter key="squared_correlation" value="false"/>
    <parameter key="cross-entropy" value="false"/>
    <parameter key="margin" value="false"/>
    <parameter key="soft_margin_loss" value="false"/>
    <parameter key="logistic_loss" value="false"/>
    <parameter key="skip_undefined_labels" value="true"/>
    <parameter key="use_example_weights" value="true"/>
    <list key="class_weights"/>
    </operator>
    <connect from_port="model" to_op="Apply Model" to_port="model"/>
    <connect from_port="test set" to_op="Apply Model" to_port="unlabelled data"/>
    <connect from_op="Apply Model" from_port="labelled data" to_op="Performance" to_port="labelled data"/>
    <connect from_op="Performance" from_port="performance" to_port="performance 1"/>
    <portSpacing port="source_model" spacing="0"/>
    <portSpacing port="source_test set" spacing="0"/>
    <portSpacing port="source_through 1" spacing="0"/>
    <portSpacing port="sink_test set results" spacing="0"/>
    <portSpacing port="sink_performance 1" spacing="0"/>
    <portSpacing port="sink_performance 2" spacing="0"/>
    </process>
    </operator>
    <connect from_op="Retrieve Titanic Training" from_port="output" to_op="Cross Validation" to_port="example set"/>
    <connect from_op="Cross Validation" from_port="model" to_port="result 1"/>
    <connect from_op="Cross Validation" from_port="performance 1" to_port="result 2"/>
    <portSpacing port="source_input 1" spacing="0"/>
    <portSpacing port="sink_result 1" spacing="18"/>
    <portSpacing port="sink_result 2" spacing="0"/>
    <portSpacing port="sink_result 3" spacing="0"/>
    </process>
    </operator>
    </process>


    Regards,
    Varun
    https://www.varunmandalapu.com/

    Be Safe. Follow precautions and Maintain Social Distancing

  • ozgeozyazarozgeozyazar Member Posts: 21 Maven
    Please find below;

    <?xml version="1.0" encoding="UTF-8"?><process version="8.0.001">
      <context>
        <input/>
        <output/>
        <macros/>
      </context>
      <operator activated="true" class="process" compatibility="8.0.001" expanded="true" name="Process">
        <process expanded="true">
          <operator activated="true" class="read_excel" compatibility="8.0.001" expanded="true" height="68" name="Read Excel" width="90" x="45" y="34">
            <parameter key="excel_file" value="C:\Users\AngelsChange\Desktop\SPSS-TEZ\Descriptive 2\MACRO\MACRO_KNN.xlsx"/>
            <parameter key="imported_cell_range" value="A1:AQ1100"/>
            <parameter key="first_row_as_names" value="false"/>
            <list key="annotations">
              <parameter key="0" value="Name"/>
            </list>
            <list key="data_set_meta_data_information">
              <parameter key="0" value="ID.false.integer.attribute"/>
              <parameter key="1" value="DISEASE_DURATION.false.integer.attribute"/>
              <parameter key="2" value="AGE.false.integer.attribute"/>
              <parameter key="3" value="WEIGHT.false.numeric.attribute"/>
              <parameter key="4" value="HEIGHT.true.real.attribute"/>
              <parameter key="5" value="BMI.false.real.attribute"/>
              <parameter key="6" value="FBG.true.integer.attribute"/>
              <parameter key="7" value="PBG.false.numeric.attribute"/>
              <parameter key="8" value="HbA1c.false.numeric.attribute"/>
              <parameter key="9" value="FBG_HbA1c.true.real.attribute"/>
              <parameter key="10" value="PBG_HbA1c.true.numeric.attribute"/>
              <parameter key="11" value="TColl.true.numeric.attribute"/>
              <parameter key="12" value="TG.false.integer.attribute"/>
              <parameter key="13" value="HDLK.true.numeric.attribute"/>
              <parameter key="14" value="LDLK.false.numeric.attribute"/>
              <parameter key="15" value="LDL_HDL.true.numeric.attribute"/>
              <parameter key="16" value="TColl_HDL.true.numeric.attribute"/>
              <parameter key="17" value="Cr.true.numeric.attribute"/>
              <parameter key="18" value="ALB.false.numeric.attribute"/>
              <parameter key="19" value="ALB_CR.false.numeric.attribute"/>
              <parameter key="20" value="GFR.false.numeric.attribute"/>
              <parameter key="21" value="CCI.true.integer.attribute"/>
              <parameter key="22" value="CONTROL_7\.5.false.integer.attribute"/>
              <parameter key="23" value="CONTROL_6.false.integer.attribute"/>
              <parameter key="24" value="CONTROL_6\.5.false.integer.attribute"/>
              <parameter key="25" value="CONTROL_7.false.integer.attribute"/>
              <parameter key="26" value="GENDER.true.binominal.attribute"/>
              <parameter key="27" value="BACKGROUND_INFORMATION.false.integer.attribute"/>
              <parameter key="28" value="FAMILY_HEALTH_STORY.false.integer.attribute"/>
              <parameter key="29" value="INSULINE_TREATMENT.false.integer.attribute"/>
              <parameter key="30" value="BMI_DEGREE.false.integer.attribute"/>
              <parameter key="31" value="PATIENTS_STATUS.false.integer.attribute"/>
              <parameter key="32" value="SMOKING_HABIT.false.integer.attribute"/>
              <parameter key="33" value="HYPERTENSION.false.integer.attribute"/>
              <parameter key="34" value="MACRO.true.binominal.label"/>
              <parameter key="35" value="MICRO.false.integer.attribute"/>
              <parameter key="36" value="CODISEASE.false.integer.attribute"/>
              <parameter key="37" value="HBA1C_DEGREE.true.polynominal.attribute"/>
              <parameter key="38" value="GLUCOSE_LEVEL_RISK_DEGREE.false.integer.attribute"/>
              <parameter key="39" value="LIPID_PROFILE.true.polynominal.attribute"/>
              <parameter key="40" value="CREATININE_DEGREE.false.integer.attribute"/>
              <parameter key="41" value="ALBUMIN_DEGREE.false.integer.attribute"/>
              <parameter key="42" value="GFR_DEGREE.false.integer.attribute"/>
            </list>
          </operator>
          <operator activated="true" class="detect_outlier_distances" compatibility="8.0.001" expanded="true" height="82" name="Detect Outlier (Distances)" width="90" x="179" y="34"/>
          <operator activated="true" class="filter_examples" compatibility="8.0.001" expanded="true" height="103" name="Filter Examples" width="90" x="313" y="34">
            <list key="filters_list">
              <parameter key="filters_entry_key" value="outlier.equals.false"/>
            </list>
          </operator>
          <operator activated="true" class="set_role" compatibility="8.0.001" expanded="true" height="82" name="Set Role" width="90" x="447" y="34">
            <parameter key="attribute_name" value="MACRO"/>
            <parameter key="target_role" value="label"/>
            <list key="set_additional_roles"/>
          </operator>
          <operator activated="false" class="multiply" compatibility="8.0.001" expanded="true" height="68" name="Multiply" width="90" x="581" y="34"/>
          <operator activated="true" class="multiply" compatibility="8.0.001" expanded="true" height="103" name="Multiply (2)" width="90" x="447" y="187"/>
          <operator activated="true" class="tree_to_rules" compatibility="8.0.001" expanded="true" height="82" name="Tree to Rules" width="90" x="581" y="136">
            <process expanded="true">
              <operator activated="true" class="concurrency:cross_validation" compatibility="8.0.001" expanded="true" height="145" name="Cross Validation" width="90" x="246" y="136">
                <parameter key="number_of_folds" value="71"/>
                <process expanded="true">
                  <operator activated="true" class="concurrency:parallel_decision_tree" compatibility="8.0.001" expanded="true" height="103" name="Decision Tree" width="90" x="45" y="34">
                    <parameter key="criterion" value="information_gain"/>
                    <parameter key="maximal_depth" value="60"/>
                    <parameter key="confidence" value="0.45"/>
                    <parameter key="apply_prepruning" value="false"/>
                    <parameter key="minimal_gain" value="0.46"/>
                  </operator>
                  <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"/>
                  <portSpacing port="sink_through 1" spacing="0"/>
                </process>
                <process expanded="true">
                  <operator activated="true" class="apply_model" compatibility="8.0.001" expanded="true" height="82" name="Apply Model" width="90" x="45" y="34">
                    <list key="application_parameters"/>
                  </operator>
                  <operator activated="true" class="performance" compatibility="8.0.001" expanded="true" height="82" name="Performance" width="90" x="179" y="34"/>
                  <connect from_port="model" to_op="Apply Model" to_port="model"/>
                  <connect from_port="test set" to_op="Apply Model" to_port="unlabelled data"/>
                  <connect from_op="Apply Model" from_port="labelled data" to_op="Performance" to_port="labelled data"/>
                  <connect from_op="Performance" from_port="performance" to_port="performance 1"/>
                  <portSpacing port="source_model" spacing="0"/>
                  <portSpacing port="source_test set" spacing="0"/>
                  <portSpacing port="source_through 1" spacing="0"/>
                  <portSpacing port="sink_test set results" spacing="0"/>
                  <portSpacing port="sink_performance 1" spacing="0"/>
                  <portSpacing port="sink_performance 2" spacing="0"/>
                </process>
              </operator>
              <connect from_port="training set" to_op="Cross Validation" to_port="example set"/>
              <connect from_op="Cross Validation" 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="concurrency:cross_validation" compatibility="8.0.001" expanded="true" height="145" name="Cross Validation (2)" width="90" x="514" y="340">
            <parameter key="number_of_folds" value="71"/>
            <process expanded="true">
              <operator activated="true" class="concurrency:parallel_decision_tree" compatibility="8.0.001" expanded="true" height="103" name="Decision Tree (2)" width="90" x="45" y="34">
                <parameter key="criterion" value="information_gain"/>
                <parameter key="maximal_depth" value="60"/>
                <parameter key="confidence" value="0.45"/>
                <parameter key="apply_prepruning" value="false"/>
                <parameter key="minimal_gain" value="0.46"/>
              </operator>
              <connect from_port="training set" to_op="Decision Tree (2)" to_port="training set"/>
              <connect from_op="Decision Tree (2)" from_port="model" to_port="model"/>
              <portSpacing port="source_training set" spacing="0"/>
              <portSpacing port="sink_model" spacing="0"/>
              <portSpacing port="sink_through 1" spacing="0"/>
            </process>
            <process expanded="true">
              <operator activated="true" class="apply_model" compatibility="8.0.001" expanded="true" height="82" name="Apply Model (2)" width="90" x="45" y="34">
                <list key="application_parameters"/>
              </operator>
              <operator activated="true" class="performance" compatibility="8.0.001" expanded="true" height="82" name="Performance (2)" width="90" x="179" y="34"/>
              <connect from_port="model" to_op="Apply Model (2)" to_port="model"/>
              <connect from_port="test set" to_op="Apply Model (2)" to_port="unlabelled data"/>
              <connect from_op="Apply Model (2)" from_port="labelled data" to_op="Performance (2)" to_port="labelled data"/>
              <connect from_op="Performance (2)" from_port="performance" to_port="performance 1"/>
              <portSpacing port="source_model" spacing="0"/>
              <portSpacing port="source_test set" spacing="0"/>
              <portSpacing port="source_through 1" spacing="0"/>
              <portSpacing port="sink_test set results" spacing="0"/>
              <portSpacing port="sink_performance 1" spacing="0"/>
              <portSpacing port="sink_performance 2" spacing="0"/>
            </process>
          </operator>
          <connect from_port="input 1" to_op="Read Excel" to_port="file"/>
          <connect from_op="Read Excel" from_port="output" to_op="Detect Outlier (Distances)" to_port="example set input"/>
          <connect from_op="Detect Outlier (Distances)" from_port="example set output" to_op="Filter Examples" to_port="example set input"/>
          <connect from_op="Filter Examples" from_port="example set output" to_op="Set Role" to_port="example set input"/>
          <connect from_op="Set Role" from_port="example set output" to_op="Multiply (2)" to_port="input"/>
          <connect from_op="Multiply (2)" from_port="output 1" to_op="Tree to Rules" to_port="training set"/>
          <connect from_op="Multiply (2)" from_port="output 2" to_op="Cross Validation (2)" to_port="example set"/>
          <connect from_op="Tree to Rules" from_port="model" to_port="result 1"/>
          <connect from_op="Tree to Rules" from_port="example set" to_port="result 2"/>
          <connect from_op="Cross Validation (2)" from_port="model" to_port="result 4"/>
          <connect from_op="Cross Validation (2)" from_port="performance 1" to_port="result 3"/>
          <portSpacing port="source_input 1" spacing="0"/>
          <portSpacing port="source_input 2" 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"/>
        </process>
      </operator>
    </process>




Sign In or Register to comment.