Options

[Solved] Extract discretization model

aryan_hosseinzaaryan_hosseinza Member Posts: 74 Contributor II
Hi ,

I'd to know if it is possible to extract discretization model (intervals) out of discretization operator ?

What I'd like to do is to find appropriate intervals on dataset A and apply it on dataset B in chi-square or entropy-based discretization methods,


Thanks

Answers

  • Options
    awchisholmawchisholm RapidMiner Certified Expert, Member Posts: 458 Unicorn
    Hello

    The Discretize operator produces a model that you can apply to other data using the Apply Model operator.

    Here's an example.
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <process version="5.3.005">
      <context>
        <input/>
        <output/>
        <macros/>
      </context>
      <operator activated="true" class="process" compatibility="5.3.005" expanded="true" name="Process">
        <process expanded="true">
          <operator activated="true" class="generate_data" compatibility="5.3.005" expanded="true" height="60" name="Generate Data" width="90" x="45" y="75">
            <parameter key="attributes_lower_bound" value="3.0"/>
            <parameter key="attributes_upper_bound" value="7.0"/>
          </operator>
          <operator activated="true" class="discretize_by_bins" compatibility="5.3.005" expanded="true" height="94" name="Discretize" width="90" x="246" y="75">
            <parameter key="number_of_bins" value="3"/>
          </operator>
          <operator activated="true" class="generate_data" compatibility="5.3.005" expanded="true" height="60" name="Generate Data (2)" width="90" x="45" y="300">
            <parameter key="attributes_lower_bound" value="0.0"/>
          </operator>
          <operator activated="true" class="apply_model" compatibility="5.3.005" expanded="true" height="76" name="Apply Model" width="90" x="313" y="300">
            <list key="application_parameters"/>
          </operator>
          <connect from_op="Generate Data" from_port="output" to_op="Discretize" to_port="example set input"/>
          <connect from_op="Discretize" from_port="example set output" to_port="result 1"/>
          <connect from_op="Discretize" from_port="preprocessing model" to_op="Apply Model" to_port="model"/>
          <connect from_op="Generate Data (2)" from_port="output" to_op="Apply Model" to_port="unlabelled data"/>
          <connect from_op="Apply Model" from_port="labelled data" 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>
    I hope that's what you meant.

    regards

    Andrew
  • Options
    aryan_hosseinzaaryan_hosseinza Member Posts: 74 Contributor II
    Thanks a lot ,
    Arian
Sign In or Register to comment.