Convert model output to example set

New Altair Community Member
Updated by Jocelyn
I am trying to convert the coefficients table from a linear regression in to an example set. Any ideas? I have begun using the Execute Script operator but I can't get it bring back exactly what I need.
Cheers,
Mike
Cheers,
Mike
Find more posts tagged with
Sort by:
1 - 4 of
41
In case of an regression problem you can apply the model onto a dataset with all attributes=0. In this case the prediction is the intercept.
Example process:
Example process:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<process version="6.1.001-SNAPSHOT">
<context>
<input/>
<output/>
<macros/>
</context>
<operator activated="true" class="process" compatibility="6.1.001-SNAPSHOT" expanded="true" name="Process">
<process expanded="true">
<operator activated="true" class="generate_data" compatibility="6.1.001-SNAPSHOT" expanded="true" height="60" name="Generate Data" width="90" x="45" y="210"/>
<operator activated="true" class="multiply" compatibility="6.1.001-SNAPSHOT" expanded="true" height="94" name="Multiply" width="90" x="246" y="165"/>
<operator activated="true" class="loop_attributes" compatibility="6.1.001-SNAPSHOT" expanded="true" height="76" name="Loop Attributes" width="90" x="380" y="345">
<process expanded="true">
<operator activated="true" class="set_data" compatibility="6.1.001-SNAPSHOT" expanded="true" height="76" name="Set Data" width="90" x="179" y="120">
<parameter key="example_index" value="1"/>
<parameter key="attribute_name" value="%{loop_attribute}"/>
<parameter key="value" value="0"/>
<list key="additional_values"/>
</operator>
<connect from_port="example set" to_op="Set Data" to_port="example set input"/>
<connect from_op="Set Data" from_port="example set output" to_port="example set"/>
<portSpacing port="source_example set" spacing="0"/>
<portSpacing port="sink_example set" spacing="0"/>
<portSpacing port="sink_result 1" spacing="0"/>
</process>
</operator>
<operator activated="true" class="filter_examples" compatibility="6.1.001-SNAPSHOT" expanded="true" height="94" name="Filter Examples" width="90" x="514" y="345">
<list key="filters_list">
<parameter key="filters_entry_key" value="att1.eq.0"/>
</list>
</operator>
<operator activated="true" class="linear_regression" compatibility="6.1.001-SNAPSHOT" expanded="true" height="94" name="Linear Regression" width="90" x="447" y="120"/>
<operator activated="true" class="apply_model" compatibility="6.1.001-SNAPSHOT" expanded="true" height="76" name="Apply Model" width="90" x="581" y="210">
<list key="application_parameters"/>
</operator>
<connect from_op="Generate Data" from_port="output" to_op="Multiply" to_port="input"/>
<connect from_op="Multiply" from_port="output 1" to_op="Linear Regression" to_port="training set"/>
<connect from_op="Multiply" from_port="output 2" to_op="Loop Attributes" to_port="example set"/>
<connect from_op="Loop Attributes" from_port="example set" to_op="Filter Examples" to_port="example set input"/>
<connect from_op="Filter Examples" from_port="example set output" to_op="Apply Model" to_port="unlabelled data"/>
<connect from_op="Linear Regression" from_port="model" to_op="Apply Model" to_port="model"/>
<connect from_op="Apply Model" from_port="labelled data" to_port="result 1"/>
<connect from_op="Apply Model" from_port="model" to_port="result 2"/>
<portSpacing port="source_input 1" spacing="0"/>
<portSpacing port="sink_result 1" spacing="180"/>
<portSpacing port="sink_result 2" spacing="18"/>
<portSpacing port="sink_result 3" spacing="0"/>
</process>
</operator>
</process>
You can simply use this in combination with Weights to Data.
Here is an example process based on sonar data