"Converting weights - read weights operator"
HI
How do I convert my output from my model (in which I have produced optimised weights for my attributes shown in the results page) into an attributes_weights_file (*.wgt) so I am able to use the "read weights" operator to import these weights and apply them to a new set of data ??
Thanks
Schills
How do I convert my output from my model (in which I have produced optimised weights for my attributes shown in the results page) into an attributes_weights_file (*.wgt) so I am able to use the "read weights" operator to import these weights and apply them to a new set of data ??
Thanks
Schills
Sort by:
1 - 4 of
41
Hello
What do you mean you can retrieve weights as "every other object"? My weights are not generated in rapid miner like in your process below, but are instead stored in an external source (microsoft excel sheet). If I am to retrieve these weights in the normal way, rapid miner thinks it is data and not weights.
So my question is how do I use weights from an external source and apply it to data within rapid miner by using the "scale by weights operator"? I have tried but when i connect my weights data into the weights input port on the scale by weights operator, it wont work because the data (weights) are not recognised as weights....
What do you mean you can retrieve weights as "every other object"? My weights are not generated in rapid miner like in your process below, but are instead stored in an external source (microsoft excel sheet). If I am to retrieve these weights in the normal way, rapid miner thinks it is data and not weights.
So my question is how do I use weights from an external source and apply it to data within rapid miner by using the "scale by weights operator"? I have tried but when i connect my weights data into the weights input port on the scale by weights operator, it wont work because the data (weights) are not recognised as weights....
Hello,
You could use a rather cludgy approach with the "weight by user specification" operator. I made a quick and dirty example that takes an example set (that could be external) and makes a weights object from it.
regards
Andrew
You could use a rather cludgy approach with the "weight by user specification" operator. I made a quick and dirty example that takes an example set (that could be external) and makes a weights object from it.
regards
Andrew
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<process version="5.1.002">
<context>
<input/>
<output/>
<macros/>
</context>
<operator activated="true" class="process" compatibility="5.1.002" expanded="true" name="Process">
<process expanded="true" height="550" width="955">
<operator activated="true" class="generate_data" compatibility="5.1.002" expanded="true" height="60" name="Generate Data" width="90" x="45" y="30">
<parameter key="number_examples" value="1"/>
<parameter key="attributes_lower_bound" value="0.0"/>
<parameter key="attributes_upper_bound" value="1.0"/>
</operator>
<operator activated="true" class="extract_macro" compatibility="5.1.002" expanded="true" height="60" name="Extract Macro" width="90" x="45" y="120">
<parameter key="macro" value="att1Weight"/>
<parameter key="macro_type" value="statistics"/>
<parameter key="statistics" value="max"/>
<parameter key="attribute_name" value="att1"/>
</operator>
<operator activated="true" class="extract_macro" compatibility="5.1.002" expanded="true" height="60" name="Extract Macro (2)" width="90" x="45" y="210">
<parameter key="macro" value="att2Weight"/>
<parameter key="macro_type" value="statistics"/>
<parameter key="statistics" value="max"/>
<parameter key="attribute_name" value="att2"/>
</operator>
<operator activated="true" class="extract_macro" compatibility="5.1.002" expanded="true" height="60" name="Extract Macro (3)" width="90" x="45" y="300">
<parameter key="macro" value="att3Weight"/>
<parameter key="macro_type" value="statistics"/>
<parameter key="statistics" value="max"/>
<parameter key="attribute_name" value="att3"/>
</operator>
<operator activated="true" class="extract_macro" compatibility="5.1.002" expanded="true" height="60" name="Extract Macro (4)" width="90" x="45" y="390">
<parameter key="macro" value="att4Weight"/>
<parameter key="macro_type" value="statistics"/>
<parameter key="statistics" value="max"/>
<parameter key="attribute_name" value="att4"/>
</operator>
<operator activated="true" class="extract_macro" compatibility="5.1.002" expanded="true" height="60" name="Extract Macro (5)" width="90" x="45" y="480">
<parameter key="macro" value="att5Weight"/>
<parameter key="macro_type" value="statistics"/>
<parameter key="statistics" value="max"/>
<parameter key="attribute_name" value="att5"/>
</operator>
<operator activated="true" class="weight_by_user_specification" compatibility="5.1.002" expanded="true" height="76" name="Weight by User Specification" width="90" x="246" y="165">
<parameter key="normalize_weights" value="false"/>
<list key="name_regex_to_weights">
<parameter key="att1.*" value="%{att1Weight}"/>
<parameter key="att2.*" value="%{att2Weight}"/>
<parameter key="att3.*" value="%{att3Weight}"/>
<parameter key="att4.*" value="%{att4Weight}"/>
<parameter key="att5.*" value="%{att5Weight}"/>
</list>
</operator>
<connect from_op="Generate Data" from_port="output" to_op="Extract Macro" to_port="example set"/>
<connect from_op="Extract Macro" from_port="example set" to_op="Extract Macro (2)" to_port="example set"/>
<connect from_op="Extract Macro (2)" from_port="example set" to_op="Extract Macro (3)" to_port="example set"/>
<connect from_op="Extract Macro (3)" from_port="example set" to_op="Extract Macro (4)" to_port="example set"/>
<connect from_op="Extract Macro (4)" from_port="example set" to_op="Extract Macro (5)" to_port="example set"/>
<connect from_op="Extract Macro (5)" from_port="example set" to_op="Weight by User Specification" to_port="example set"/>
<connect from_op="Weight by User Specification" from_port="weights" to_port="result 1"/>
<portSpacing port="source_input 1" spacing="0"/>
<portSpacing port="sink_result 1" spacing="0"/>
<portSpacing port="sink_result 2" spacing="0"/>
</process>
</operator>
</process>
you can simply store and retrieve weights as every other object in RapidMiner. You don't need to use read or write weights at all.
You can apply weights on a dataset by using "scale by Weights". See the following example process: Greetings,
Sebastian