RapidMiner 9.7 is Now Available

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

CLICK HERE TO DOWNLOAD

Forcing YAGGA2 to use an attribute in every individual causes senseless WEPTrees

BAMBAMBAMBAMBAMBAM Member Posts: 20  Maven
edited November 2018 in Help
Hi,

I've got a YAGGA2 process that feeds attributes to a WEPTree, and I would like the WEPTree to always use a particular attribute (Entry_OVR_Close).  I've come up with a process to do this, but it yields very strange, contradictory WEPTrees.  Here is a sample output:

REPTree
============

Entry_OVR_Close < 0
|  Entry_OVR_Close < 0 : 0.11 (264/0.1) [139/0.02]
|  Entry_OVR_Close >= 0 : 0.03 (587/0.02) [316/0.02]
Entry_OVR_Close >= 0
|  Entry_OVR_Close < 0
|  |  Entry_OVR_Close < 0 : -0.02 (590/0.01) [256/0.01]
|  |  Entry_OVR_Close >= 0 : -0.05 (221/0.02) [118/0.02]
|  Entry_OVR_Close >= 0 : -0.1 (470/0.01) [238/0.03]

For this particular output, the WEPTree could choose from roughly eight possible attributes, but ended up choosing only Entry_OVR_Close.  The weird thing is that the rules don't make sense - each leaf covers the possibilities that both Entry_OVR_Close<0 AND Entry_OVR_Close>=0.  Any ideas on how I could prevent this?

Here is my process:
<operator name="Root" class="Process" expanded="yes">
    <description text="TYPE #ylt# 0.5 |  Entry_OVR_Close #ylt# 0.5 |  |  PercentR_50 #ylt# 0.5 |  |  |  PercentR_20 #ylt# 0.5 |  |  |  |  prcK_201 #ylt# 0.5 |  |  |  |  |  prcK_141 #ylt# 0.5 |  |  |  |  |  |  prcK_341 #ylt# 0.5 |  |  |  |  |  |  |  PercentR_8 #ylt# 0.5 |  |  |  |  |  |  |  |  RSI_8C #ylt# 0.5 : 0.01 (13126/0) [6575/0] |  |  |  |  |  |  |  |  RSI_8C #ygt#= 0.5 : 0.03 (526/0) [275/0] |  |  |  |  |  |  |  PercentR_8 #ygt#= 0.5 : 0.04 (576/0) [296/0] |  |  |  |  |  |  prcK_341 #ygt#= 0.5 : 0.08 (970/0) [516/0] |  |  |  |  |  prcK_141 #ygt#= 0.5 : 0.08 (1005/0) [517/0] |  |  |  |  prcK_201 #ygt#= 0.5 : 0.08 (1309/0) [665/0] |  |  |  PercentR_20 #ygt#= 0.5 : 0.08 (1405/0) [726/0] |  |  PercentR_50 #ygt#= 0.5 : 0.08 (1315/0) [642/0] |  Entry_OVR_Close #ygt#= 0.5 : 0.13 (5026/0.01) [2498/0.01] TYPE #ygt#= 0.5 |  Entry_OVR_Close #ylt# 0.5 |  |  PercentR_20 #ylt# 0.5 : 0.14 (2934/0) [1406/0] |  |  PercentR_20 #ygt#= 0.5 |  |  |  SYM_DIF_SPY_ArnUp8 #ylt# 0.5 : 0.16 (5992/0) [2909/0] |  |  |  SYM_DIF_SPY_ArnUp8 #ygt#= 0.5 : 0.2 (665/0) [364/0] |  Entry_OVR_Close #ygt#= 0.5 |  |  CCI_50C #ylt# 0.5 : 0.31 (2032/0.05) [1082/0.05] |  |  CCI_50C #ygt#= 0.5 : 0.48 (583/0) [262/0]"/>
    <parameter key="logverbosity" value="error"/>
    <operator name="LoadData" class="OperatorChain" expanded="yes">
        <operator name="MacroDefinition" class="MacroDefinition">
            <list key="macros">
              <parameter key="baseName" value="longs"/>
            </list>
        </operator>
        <operator name="ExampleSource" class="ExampleSource" activated="no">
            <parameter key="attributes" value="jpriorsTrades.att"/>
            <parameter key="local_random_seed" value="2001"/>
        </operator>
        <operator name="CSVExampleSource" class="CSVExampleSource">
            <parameter key="filename" value="I:\Trading\RapidMiner\MetaTrader\longs.csv"/>
            <parameter key="label_name" value="EFF"/>
            <parameter key="id_name" value="id"/>
        </operator>
        <operator name="ExampleSetWriter" class="ExampleSetWriter">
            <parameter key="example_set_file" value="longs.rmd"/>
            <parameter key="attribute_description_file" value="longs.att"/>
        </operator>
        <operator name="ChangeAttributeRole" class="ChangeAttributeRole" activated="no">
            <parameter key="name" value="TYPE"/>
            <parameter key="target_role" value="i1"/>
        </operator>
        <operator name="ChangeAttributeRole (2)" class="ChangeAttributeRole">
            <parameter key="name" value="Entry_OVR_Close"/>
            <parameter key="target_role" value="i2"/>
        </operator>
        <operator name="ChangeAttributeRole (3)" class="ChangeAttributeRole" activated="no">
            <parameter key="name" value="CCI_50C"/>
            <parameter key="target_role" value="i3"/>
        </operator>
    </operator>
    <operator name="YAGGA2" class="YAGGA2" breakpoints="after" expanded="yes">
        <parameter key="local_random_seed" value="2001"/>
        <parameter key="population_size" value="1000"/>
        <parameter key="maximum_number_of_generations" value="25"/>
        <parameter key="generations_without_improval" value="3"/>
        <parameter key="keep_best_individual" value="true"/>
        <parameter key="p_initialize" value="0.02"/>
        <parameter key="use_plus" value="false"/>
        <parameter key="use_diff" value="true"/>
        <parameter key="use_div" value="true"/>
        <parameter key="p_mutation" value="0.1"/>
        <parameter key="use_square_roots" value="true"/>
        <parameter key="use_sin" value="false"/>
        <parameter key="use_exp" value="false"/>
        <parameter key="use_absolute_values" value="false"/>
        <parameter key="equivalence_use_statistics" value="false"/>
        <parameter key="constant_generation_prob" value="0.0"/>
        <operator name="XValidation" class="XValidation" expanded="yes">
            <parameter key="keep_example_set" value="true"/>
            <parameter key="number_of_validations" value="3"/>
            <parameter key="sampling_type" value="shuffled sampling"/>
            <parameter key="local_random_seed" value="1992"/>
            <operator name="OperatorChain" class="OperatorChain" expanded="yes">
                <operator name="ChangeAttributeRole (4)" class="ChangeAttributeRole" activated="no">
                    <parameter key="name" value="TYPE"/>
                </operator>
                <operator name="ChangeAttributeRole (6)" class="ChangeAttributeRole">
                    <parameter key="name" value="Entry_OVR_Close"/>
                </operator>
                <operator name="ChangeAttributeRole (5)" class="ChangeAttributeRole" activated="no">
                    <parameter key="name" value="CCI_50C"/>
                </operator>
                <operator name="Construction2Names" class="Construction2Names">
                </operator>
                <operator name="W-REPTree" class="W-REPTree">
                    <parameter key="keep_example_set" value="true"/>
                    <parameter key="M" value="100.0"/>
                </operator>
                <operator name="LinearRegression" class="LinearRegression" activated="no">
                    <parameter key="keep_example_set" value="true"/>
                </operator>
                <operator name="MemoryCleanUp" class="MemoryCleanUp">
                </operator>
            </operator>
            <operator name="ApplierChain" class="OperatorChain" expanded="yes">
                <operator name="Applier" class="ModelApplier">
                    <parameter key="keep_model" value="true"/>
                    <list key="application_parameters">
                    </list>
                </operator>
                <operator name="RegressionPerformance" class="RegressionPerformance">
                    <parameter key="main_criterion" value="spearman_rho"/>
                    <parameter key="spearman_rho" value="true"/>
                    <parameter key="use_example_weights" value="false"/>
                </operator>
                <operator name="PerfWriter" class="ResultWriter">
                    <parameter key="result_file" value="%{baseName}_attrWeights.txt"/>
                </operator>
                <operator name="ProcessLog" class="ProcessLog">
                    <list key="log">
                      <parameter key="Perf" value="operator.RegressionPerformance.value.performance"/>
                      <parameter key="Tries" value="operator.RegressionPerformance.value.applycount"/>
                      <parameter key="len" value="operator.YAGGA2.value.average_length"/>
                      <parameter key="gen" value="operator.YAGGA2.value.generation"/>
                    </list>
                </operator>
                <operator name="ChangeAttributeRole (7)" class="ChangeAttributeRole" activated="no">
                    <parameter key="name" value="TYPE"/>
                    <parameter key="target_role" value="i1"/>
                </operator>
                <operator name="ChangeAttributeRole (8)" class="ChangeAttributeRole">
                    <parameter key="name" value="Entry_OVR_Close"/>
                    <parameter key="target_role" value="i2"/>
                </operator>
                <operator name="ChangeAttributeRole (9)" class="ChangeAttributeRole" activated="no">
                    <parameter key="name" value="CCI_50C"/>
                    <parameter key="target_role" value="i3"/>
                </operator>
            </operator>
        </operator>
    </operator>
    <operator name="AttributeWeightSelection" class="AttributeWeightSelection" breakpoints="after">
        <parameter key="weight" value="0.0"/>
        <parameter key="weight_relation" value="greater"/>
    </operator>
    <operator name="FinalTree" class="W-REPTree" breakpoints="after">
        <parameter key="keep_example_set" value="true"/>
        <parameter key="M" value="50.0"/>
    </operator>
    <operator name="FinalRegression" class="LinearRegression" breakpoints="after" activated="no">
        <parameter key="keep_example_set" value="true"/>
    </operator>
    <operator name="ModelWriter" class="ModelWriter" breakpoints="after">
        <parameter key="model_file" value="LinearRegressionModel.xml"/>
        <parameter key="output_type" value="XML"/>
    </operator>
    <operator name="ModelApplier" class="ModelApplier" breakpoints="after">
        <list key="application_parameters">
        </list>
    </operator>
    <operator name="FinalPerf" class="RegressionPerformance" breakpoints="after">
        <parameter key="main_criterion" value="spearman_rho"/>
        <parameter key="spearman_rho" value="true"/>
        <parameter key="use_example_weights" value="false"/>
    </operator>
</operator>

thanks in advance,
John

Answers

  • landland RapidMiner Certified Analyst, RapidMiner Certified Expert, Member Posts: 2,529   Unicorn
    Hi,
    sorry I cannot say anything about the W-REPTree because it's not one of our learners and I don't have a clue, what it does anyway...

    Greetings,
      Sebastian
  • BAMBAMBAMBAMBAMBAM Member Posts: 20  Maven
    Sebastion, could you suggest a learner that Rapid does know about, which outputs human-understandable rules and can handle numeric inputs and outputs?

    thank you,
    JOhn
  • landland RapidMiner Certified Analyst, RapidMiner Certified Expert, Member Posts: 2,529   Unicorn
    Hi,
    unfortunately our own regression tree was dropped during one of the early version changes in 4.x. So unfortunately I cannot recommend you anyone.

    Greetings,
      Sebastian
Sign In or Register to comment.