Options

Correct use of "free memory" operator

wesselwessel Member Posts: 537 Maven
I want evaluate about one thousand attribute subsets using attribute selection.
I found that there was a problem with memory usage, it was ever growing,
and when 12 GB became full and the system had to use the swap file things became really slow.

I added the operator "free memory". But I'm new to using this operator.
Where in the process should it be placed?
Here?

<?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="Root">
    <process expanded="true" height="494" width="705">
      <operator activated="true" class="retrieve" expanded="true" height="60" name="Retrieve" width="90" x="45" y="30">
        <parameter key="repository_entry" value="//LelyReposit/RFManGen"/>
      </operator>
      <operator activated="true" class="filter_examples" expanded="true" height="76" name="label != 4" width="90" x="180" y="30">
        <parameter key="condition_class" value="attribute_value_filter"/>
        <parameter key="parameter_string" value="label != 4"/>
      </operator>
      <operator activated="true" class="filter_examples" expanded="true" height="76" name="label != 8" width="90" x="315" y="30">
        <parameter key="condition_class" value="attribute_value_filter"/>
        <parameter key="parameter_string" value="label != 8"/>
      </operator>
      <operator activated="true" class="numerical_to_binominal" expanded="true" height="76" name="binom label" width="90" x="450" y="30">
        <parameter key="attribute_filter_type" value="single"/>
        <parameter key="attribute" value="label"/>
        <parameter key="include_special_attributes" value="true"/>
      </operator>
      <operator activated="true" class="filter_examples" expanded="true" height="76" name="num &gt; 30" width="90" x="585" y="30">
        <parameter key="condition_class" value="attribute_value_filter"/>
        <parameter key="parameter_string" value="num &gt; 30"/>
      </operator>
      <operator activated="true" class="optimize_selection" expanded="true" height="94" name="FS" width="90" x="45" y="120">
        <parameter key="generations_without_improval" value="5"/>
        <parameter key="keep_best" value="5"/>
        <process expanded="true" height="494" width="701">
          <operator activated="true" class="split_data" expanded="true" height="94" name="Split Data" width="90" x="45" y="300">
            <enumeration key="partitions">
              <parameter key="ratio" value="0.5"/>
              <parameter key="ratio" value="0.5"/>
            </enumeration>
            <parameter key="sampling_type" value="linear sampling"/>
          </operator>
          <operator activated="true" class="select_attributes" expanded="true" height="76" name="no special" width="90" x="45" y="30">
            <parameter key="attribute_filter_type" value="regular_expression"/>
            <parameter key="regular_expression" value="label|num|AniLacId|Dis012"/>
            <parameter key="invert_selection" value="true"/>
            <parameter key="include_special_attributes" value="true"/>
          </operator>
          <operator activated="true" class="weka:W-J48" expanded="true" height="76" name="W-J48" width="90" x="179" y="120">
            <parameter key="M" value="20.0"/>
          </operator>
          <operator activated="true" class="free_memory" expanded="true" height="76" name="Free Memory (2)" width="90" x="313" y="120"/>
          <operator activated="true" class="execute_script" expanded="true" height="76" name="Execute Script" width="90" x="179" y="30">
            <parameter key="script" value="ExampleSet exampleSet = operator.getInput(ExampleSet.class);&#13;&#10;&#13;&#10;String atts = &quot;&quot;;&#13;&#10;&#10;for (Attribute attribute : exampleSet.getAttributes()) {&#10;    String name = attribute.getName();&#13;&#13;&#13;&#13;&#10;&#9;atts = atts + name + &quot;\t&quot;;&#13;&#10;}&#13;&#13;&#13;&#10;&#10;operator.getProcess().getMacroHandler().addMacro(&quot;atts&quot;, atts)"/>
          </operator>
          <operator activated="true" class="apply_model" expanded="true" height="76" name="Applier" width="90" x="112" y="210">
            <list key="application_parameters"/>
          </operator>
          <operator activated="true" class="performance_binominal_classification" expanded="true" height="76" name="BiPerf" width="90" x="246" y="210">
            <parameter key="accuracy" value="false"/>
            <parameter key="kappa" value="true"/>
            <parameter key="AUC" value="true"/>
            <parameter key="sensitivity" value="true"/>
            <parameter key="specificity" value="true"/>
          </operator>
          <operator activated="true" class="provide_macro_as_log_value" expanded="true" height="76" name="Provide Macro as Log Value" width="90" x="313" y="30">
            <parameter key="macro_name" value="atts"/>
          </operator>
          <operator activated="true" class="free_memory" expanded="true" height="76" name="Free Memory" width="90" x="447" y="30"/>
          <operator activated="true" class="log" expanded="true" height="94" name="MyLog" width="90" x="581" y="120">
            <list key="log">
              <parameter key="generation" value="operator.FS.value.generation"/>
              <parameter key="atts" value="operator.Provide Macro as Log Value.value.macro_value"/>
              <parameter key="AUC" value="operator.BiPerf.value.AUC"/>
              <parameter key="kappa" value="operator.BiPerf.value.kappa"/>
              <parameter key="sensitivity" value="operator.BiPerf.value.sensitivity"/>
              <parameter key="specificity" value="operator.BiPerf.value.specificity"/>
            </list>
          </operator>
          <connect from_port="example set" to_op="Split Data" to_port="example set"/>
          <connect from_op="Split Data" from_port="partition 1" to_op="no special" to_port="example set input"/>
          <connect from_op="Split Data" from_port="partition 2" to_op="Applier" to_port="unlabelled data"/>
          <connect from_op="no special" from_port="example set output" to_op="Execute Script" to_port="input 1"/>
          <connect from_op="no special" from_port="original" to_op="W-J48" to_port="training set"/>
          <connect from_op="W-J48" from_port="model" to_op="Free Memory (2)" to_port="through 1"/>
          <connect from_op="Free Memory (2)" from_port="through 1" to_op="Applier" to_port="model"/>
          <connect from_op="Execute Script" from_port="output 1" to_op="Provide Macro as Log Value" to_port="through 1"/>
          <connect from_op="Applier" from_port="labelled data" to_op="BiPerf" to_port="labelled data"/>
          <connect from_op="BiPerf" from_port="performance" to_op="MyLog" to_port="through 1"/>
          <connect from_op="Provide Macro as Log Value" from_port="through 1" to_op="Free Memory" to_port="through 1"/>
          <connect from_op="Free Memory" from_port="through 1" to_op="MyLog" to_port="through 2"/>
          <connect from_op="MyLog" from_port="through 1" to_port="performance"/>
          <portSpacing port="source_example set" spacing="0"/>
          <portSpacing port="source_through 1" spacing="0"/>
          <portSpacing port="sink_performance" spacing="0"/>
        </process>
      </operator>
      <operator activated="true" class="log_to_data" expanded="true" height="94" name="Log to Data" width="90" x="179" y="210">
        <parameter key="log_name" value="MyLog"/>
      </operator>
      <connect from_op="Retrieve" from_port="output" to_op="label != 4" to_port="example set input"/>
      <connect from_op="label != 4" from_port="example set output" to_op="label != 8" to_port="example set input"/>
      <connect from_op="label != 8" from_port="example set output" to_op="binom label" to_port="example set input"/>
      <connect from_op="binom label" from_port="example set output" to_op="num &gt; 30" to_port="example set input"/>
      <connect from_op="num &gt; 30" from_port="example set output" to_op="FS" to_port="example set in"/>
      <connect from_op="FS" from_port="weights" to_port="result 1"/>
      <connect from_op="FS" from_port="performance" to_op="Log to Data" to_port="through 1"/>
      <connect from_op="Log to Data" from_port="exampleSet" to_port="result 3"/>
      <connect from_op="Log to Data" from_port="through 1" to_port="result 2"/>
      <portSpacing port="source_input 1" spacing="0"/>
      <portSpacing port="sink_result 1" spacing="90"/>
      <portSpacing port="sink_result 2" spacing="0"/>
      <portSpacing port="sink_result 3" spacing="0"/>
      <portSpacing port="sink_result 4" spacing="0"/>
    </process>
  </operator>
</process>

Answers

Sign In or Register to comment.