How to extract attributes from the model?
jiri
New Altair Community Member
Hi,
Is is possible to extract the single attribute determined by ONER learner model?
Something like a "ModelParameters2ExampleSet"?
Thanks,
Jiri
Is is possible to extract the single attribute determined by ONER learner model?
Something like a "ModelParameters2ExampleSet"?
Thanks,
Jiri
Tagged:
0
Answers
-
I found out a solution. Maybe little bit complicated but works..and it is usable also for other models. There is an example.
Regards
jiiri
<operator name="Root" class="Process" expanded="yes">
<operator name="ArffExampleSource" class="ArffExampleSource">
<parameter key="data_file" value="....example"/>
<parameter key="label_attribute" value="class"/>
</operator>
<operator name="IOStorer" class="IOStorer">
<parameter key="name" value="MASTER"/>
<parameter key="io_object" value="ExampleSet"/>
<parameter key="remove_from_process" value="false"/>
</operator>
<operator name="SlidingWindowValidation" class="SlidingWindowValidation" expanded="yes">
<parameter key="training_window_width" value="5"/>
<parameter key="test_window_width" value="1"/>
<parameter key="average_performances_only" value="false"/>
<operator name="OneR" class="OneR">
</operator>
<operator name="OperatorChain" class="OperatorChain" expanded="yes">
<operator name="ModelApplier" class="ModelApplier">
<parameter key="keep_model" value="true"/>
<list key="application_parameters">
</list>
</operator>
<operator name="Performance (2)" class="Performance">
<parameter key="keep_example_set" value="true"/>
<parameter key="use_example_weights" value="false"/>
</operator>
<operator name="ResultWriter" class="ResultWriter">
<parameter key="result_file" value="name"/>
</operator>
<operator name="TextObjectLoader" class="TextObjectLoader">
<parameter key="file" value="name"/>
</operator>
<operator name="DeleteResultFile" class="CommandLineOperator">
<parameter key="command" value="c:\windows\system32\cmd.exe /c del name"/>
<parameter key="log_stdout" value="false"/>
<parameter key="log_stderr" value="false"/>
</operator>
<operator name="TextExtractor" class="TextExtractor">
<parameter key="extraction_regex" value="sep\d "/>
</operator>
<operator name="TextObject2ExampleSet" class="TextObject2ExampleSet">
<parameter key="text_attribute" value="1"/>
<parameter key="label_attribute" value="0"/>
</operator>
<operator name="Data2Log" class="Data2Log">
<parameter key="attribute_name" value="1"/>
<parameter key="example_index" value="1"/>
</operator>
<operator name="ProcessLog" class="ProcessLog">
<list key="log">
<parameter key="attr" value="operator.Data2Log.value.data_value"/>
<parameter key="count" value="operator.OperatorChain.value.applycount"/>
</list>
</operator>
<operator name="ProcessLog2ExampleSet" class="ProcessLog2ExampleSet">
<parameter key="log_name" value="ProcessLog"/>
</operator>
<operator name="IOStorer (2)" class="IOStorer">
<parameter key="name" value="ATTR"/>
<parameter key="io_object" value="ExampleSet"/>
</operator>
</operator>
</operator>
<operator name="IORetriever (2)" class="IORetriever">
<parameter key="name" value="ATTR"/>
<parameter key="io_object" value="ExampleSet"/>
</operator>
<operator name="IdTagging" class="IdTagging">
</operator>
<operator name="IORetriever" class="IORetriever">
<parameter key="name" value="MASTER"/>
<parameter key="io_object" value="ExampleSet"/>
<parameter key="remove_from_store" value="false"/>
</operator>
<operator name="IdTagging (2)" class="IdTagging">
</operator>
<operator name="ExampleSetJoin" class="ExampleSetJoin">
<parameter key="join_type" value="left"/>
</operator>
</operator>
0 -
Hi,
that's an interesting solution. And I get the impression I heard this requirement a few time in the last week, so it's pretty useful until we have added a special function for this.
Another solution would be to incorporate the Scripting operator, but this would need some programming effort and a model giving access to it's values.
Greetings,
Sebastian0