"[Solved] Missing id attribute after Windowing operator"
qwertz
New Altair Community Member
Dear all,
Seems that I have discovered yet another bug today:
Let's assume that I have 3 attributes as input for the windowing operator
date (as ID)
figures1 (without special role)
figures2 (without special role)
Windowing operator provides the following output
date (as ID)
label (as label)
figures1-0
figures2-0
However, the "date" attribute is kind of hidden. I receive it in the results perspective but i cannot use it in other operators like "select attribute" operator (unless I change the role before). In the "select attribute" operator the "date" attribute is not shown.
PS: Another remark to the windowing operator:
It would be better if this operator would not rename the attributes like "name-0" but "name_0". Reason is that the "generate attributes" operator has problems in using this wording in the function expression because is seems to interpret it like "name minus zero".
Cheers
Sachs
Seems that I have discovered yet another bug today:
Let's assume that I have 3 attributes as input for the windowing operator
date (as ID)
figures1 (without special role)
figures2 (without special role)
Windowing operator provides the following output
date (as ID)
label (as label)
figures1-0
figures2-0
However, the "date" attribute is kind of hidden. I receive it in the results perspective but i cannot use it in other operators like "select attribute" operator (unless I change the role before). In the "select attribute" operator the "date" attribute is not shown.
PS: Another remark to the windowing operator:
It would be better if this operator would not rename the attributes like "name-0" but "name_0". Reason is that the "generate attributes" operator has problems in using this wording in the function expression because is seems to interpret it like "name minus zero".
Cheers
Sachs
Tagged:
1
Answers
-
Hi,
you can use the date attribute in subsequent operators - just type it into the combobox instead of searching it in the list. However, you are right that this is a bug and it should be shown in the list.
Your suggestion of the naming of the creating attributes sounds reasonable, maybe we'll change that in a future release.
Best, Marius0 -
Fixed the id issue, will be included in the next release of the Series extension.0
-
Hi,
--> The proposed workaround works for most of the operators. However, if it comes to "pivot" operator it won't work unless you save the example set in a file and recall it afterwards.you can use the date attribute in subsequent operators - just type it into the combobox
Bye for now
Sachs0 -
I can't believe that. Can you please provide a minimal example for the not-working Pivot operator?0
-
Here you are
I spent some more hours in error diagnostics... without success... but I feel like that it depends either on the "date" data type or that date has the role "id".
Also strange: The process doesn't through an error but the result is not the one I would expect.
Moreover, I tried to save the result in an excel file and read it again immediately before pivotizing. That's how it worked out well. *puzzled* ???
Cheers
Sachs<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<process version="5.2.006">
<context>
<input/>
<output/>
<macros/>
</context>
<operator activated="true" class="process" compatibility="5.2.006" expanded="true" name="Process">
<process expanded="true" height="359" width="882">
<operator activated="true" class="subprocess" compatibility="5.2.006" expanded="true" height="76" name="Subprocess" width="90" x="45" y="30">
<process expanded="true" height="408" width="743">
<operator activated="true" class="generate_sales_data" compatibility="5.2.006" expanded="true" height="60" name="Generate Sales Data" width="90" x="45" y="30"/>
<operator activated="true" class="select_attributes" compatibility="5.2.006" expanded="true" height="76" name="Select Attributes" width="90" x="179" y="30">
<parameter key="attribute_filter_type" value="subset"/>
<parameter key="attributes" value="|date|single_price"/>
<parameter key="include_special_attributes" value="true"/>
</operator>
<operator activated="true" class="generate_copy" compatibility="5.2.006" expanded="true" height="76" name="Generate Copy" width="90" x="313" y="30">
<parameter key="attribute_name" value="single_price"/>
<parameter key="new_name" value="single_price2"/>
</operator>
<operator activated="true" class="generate_copy" compatibility="5.2.006" expanded="true" height="76" name="Generate Copy (2)" width="90" x="447" y="30">
<parameter key="attribute_name" value="single_price"/>
<parameter key="new_name" value="single_price3"/>
</operator>
<operator activated="true" class="set_role" compatibility="5.2.006" expanded="true" height="76" name="Set Role" width="90" x="581" y="30">
<parameter key="name" value="date"/>
<parameter key="target_role" value="id"/>
<list key="set_additional_roles"/>
</operator>
<connect from_op="Generate Sales Data" from_port="output" to_op="Select Attributes" to_port="example set input"/>
<connect from_op="Select Attributes" from_port="example set output" to_op="Generate Copy" to_port="example set input"/>
<connect from_op="Generate Copy" from_port="example set output" to_op="Generate Copy (2)" to_port="example set input"/>
<connect from_op="Generate Copy (2)" from_port="example set output" to_op="Set Role" to_port="example set input"/>
<connect from_op="Set Role" from_port="example set output" to_port="out 1"/>
<portSpacing port="source_in 1" spacing="0"/>
<portSpacing port="sink_out 1" spacing="0"/>
<portSpacing port="sink_out 2" spacing="0"/>
</process>
</operator>
<operator activated="true" class="multiply" compatibility="5.2.006" expanded="true" height="94" name="Multiply" width="90" x="179" y="30"/>
<operator activated="true" class="loop_parameters" compatibility="5.2.006" expanded="true" height="94" name="Loop Parameters" width="90" x="313" y="30">
<list key="parameters">
<parameter key="Windowing.label_attribute" value="single_price,single_price2,single_price3"/>
</list>
<process expanded="true" height="390" width="743">
<operator activated="true" class="series:windowing" compatibility="5.1.002" expanded="true" height="76" name="Windowing (2)" width="90" x="45" y="165">
<parameter key="window_size" value="1"/>
</operator>
<operator activated="true" class="series:windowing" compatibility="5.1.002" expanded="true" height="76" name="Windowing" width="90" x="45" y="30">
<parameter key="horizon" value="1"/>
<parameter key="window_size" value="1"/>
<parameter key="create_label" value="true"/>
<parameter key="label_attribute" value="single_price3"/>
</operator>
<operator activated="true" class="series:sliding_window_validation" compatibility="5.1.002" expanded="true" height="112" name="Validation" width="90" x="179" y="30">
<parameter key="training_window_width" value="20"/>
<parameter key="training_window_step_size" value="5"/>
<parameter key="test_window_width" value="20"/>
<parameter key="horizon" value="5"/>
<process expanded="true">
<operator activated="true" class="support_vector_machine" compatibility="5.2.006" expanded="true" name="SVM"/>
<connect from_port="training" to_op="SVM" to_port="training set"/>
<connect from_op="SVM" from_port="model" to_port="model"/>
<portSpacing port="source_training" spacing="0"/>
<portSpacing port="sink_model" spacing="0"/>
<portSpacing port="sink_through 1" spacing="0"/>
</process>
<process expanded="true">
<operator activated="true" class="apply_model" compatibility="5.2.006" expanded="true" name="Apply Model">
<list key="application_parameters"/>
</operator>
<operator activated="true" class="series:forecasting_performance" compatibility="5.1.002" expanded="true" name="Performance">
<parameter key="horizon" value="1"/>
</operator>
<connect from_port="model" to_op="Apply Model" to_port="model"/>
<connect from_port="test set" to_op="Apply Model" to_port="unlabelled data"/>
<connect from_op="Apply Model" from_port="labelled data" to_op="Performance" to_port="labelled data"/>
<connect from_op="Performance" from_port="performance" to_port="averagable 1"/>
<portSpacing port="source_model" spacing="0"/>
<portSpacing port="source_test set" spacing="0"/>
<portSpacing port="source_through 1" spacing="0"/>
<portSpacing port="sink_averagable 1" spacing="0"/>
<portSpacing port="sink_averagable 2" spacing="0"/>
</process>
</operator>
<operator activated="true" class="apply_model" compatibility="5.2.006" expanded="true" height="76" name="Apply Model (2)" width="90" x="313" y="120">
<list key="application_parameters"/>
</operator>
<operator activated="true" class="generate_attributes" compatibility="5.2.006" expanded="true" height="76" name="Generate Attributes" width="90" x="447" y="120">
<list key="function_descriptions">
<parameter key="label_attribute" value="param("Windowing", "label_attribute")"/>
</list>
</operator>
<connect from_port="input 1" to_op="Windowing" to_port="example set input"/>
<connect from_port="input 2" to_op="Windowing (2)" to_port="example set input"/>
<connect from_op="Windowing (2)" from_port="example set output" to_op="Apply Model (2)" to_port="unlabelled data"/>
<connect from_op="Windowing" from_port="example set output" to_op="Validation" to_port="training"/>
<connect from_op="Validation" from_port="model" to_op="Apply Model (2)" to_port="model"/>
<connect from_op="Apply Model (2)" from_port="labelled data" to_op="Generate Attributes" to_port="example set input"/>
<connect from_op="Generate Attributes" from_port="example set output" to_port="result 1"/>
<portSpacing port="source_input 1" spacing="0"/>
<portSpacing port="source_input 2" spacing="0"/>
<portSpacing port="source_input 3" spacing="0"/>
<portSpacing port="sink_performance" spacing="72"/>
<portSpacing port="sink_result 1" spacing="0"/>
<portSpacing port="sink_result 2" spacing="0"/>
</process>
</operator>
<operator activated="true" class="append" compatibility="5.2.006" expanded="true" height="76" name="Append" width="90" x="447" y="30"/>
<operator activated="true" class="select_attributes" compatibility="5.2.006" expanded="true" height="76" name="Select Attributes (2)" width="90" x="581" y="30">
<parameter key="attribute_filter_type" value="subset"/>
<parameter key="attributes" value="|prediction(label)|label_attribute|date"/>
</operator>
<operator activated="true" class="pivot" compatibility="5.2.006" expanded="true" height="76" name="Pivot" width="90" x="715" y="30">
<parameter key="group_attribute" value="date"/>
<parameter key="index_attribute" value="label_attribute"/>
<parameter key="consider_weights" value="false"/>
</operator>
<connect from_op="Subprocess" from_port="out 1" to_op="Multiply" to_port="input"/>
<connect from_op="Multiply" from_port="output 1" to_op="Loop Parameters" to_port="input 1"/>
<connect from_op="Multiply" from_port="output 2" to_op="Loop Parameters" to_port="input 2"/>
<connect from_op="Loop Parameters" from_port="result 1" to_op="Append" to_port="example set 1"/>
<connect from_op="Append" from_port="merged set" to_op="Select Attributes (2)" to_port="example set input"/>
<connect from_op="Select Attributes (2)" from_port="example set output" to_op="Pivot" to_port="example set input"/>
<connect from_op="Pivot" from_port="example set output" 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>0 -
Hi,
special attributes (like date in this case) have to be set to regular before applying the Pivot Operator.
Here you go:
Best,
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<process version="5.2.007">
<context>
<input/>
<output/>
<macros/>
</context>
<operator activated="true" class="process" compatibility="5.2.007" expanded="true" name="Process">
<process expanded="true" height="359" width="882">
<operator activated="true" class="subprocess" compatibility="5.2.007" expanded="true" height="76" name="Subprocess" width="90" x="45" y="30">
<process expanded="true" height="408" width="743">
<operator activated="true" class="generate_sales_data" compatibility="5.2.007" expanded="true" height="60" name="Generate Sales Data" width="90" x="45" y="30"/>
<operator activated="true" class="select_attributes" compatibility="5.2.007" expanded="true" height="76" name="Select Attributes" width="90" x="179" y="30">
<parameter key="attribute_filter_type" value="subset"/>
<parameter key="attributes" value="|date|single_price"/>
<parameter key="include_special_attributes" value="true"/>
</operator>
<operator activated="true" class="generate_copy" compatibility="5.2.007" expanded="true" height="76" name="Generate Copy" width="90" x="313" y="30">
<parameter key="attribute_name" value="single_price"/>
<parameter key="new_name" value="single_price2"/>
</operator>
<operator activated="true" class="generate_copy" compatibility="5.2.007" expanded="true" height="76" name="Generate Copy (2)" width="90" x="447" y="30">
<parameter key="attribute_name" value="single_price"/>
<parameter key="new_name" value="single_price3"/>
</operator>
<operator activated="true" class="set_role" compatibility="5.2.007" expanded="true" height="76" name="Set Role" width="90" x="581" y="30">
<parameter key="name" value="date"/>
<parameter key="target_role" value="id"/>
<list key="set_additional_roles"/>
</operator>
<connect from_op="Generate Sales Data" from_port="output" to_op="Select Attributes" to_port="example set input"/>
<connect from_op="Select Attributes" from_port="example set output" to_op="Generate Copy" to_port="example set input"/>
<connect from_op="Generate Copy" from_port="example set output" to_op="Generate Copy (2)" to_port="example set input"/>
<connect from_op="Generate Copy (2)" from_port="example set output" to_op="Set Role" to_port="example set input"/>
<connect from_op="Set Role" from_port="example set output" to_port="out 1"/>
<portSpacing port="source_in 1" spacing="0"/>
<portSpacing port="sink_out 1" spacing="0"/>
<portSpacing port="sink_out 2" spacing="0"/>
</process>
</operator>
<operator activated="true" class="multiply" compatibility="5.2.007" expanded="true" height="94" name="Multiply" width="90" x="179" y="30"/>
<operator activated="true" class="loop_parameters" compatibility="5.2.007" expanded="true" height="94" name="Loop Parameters" width="90" x="313" y="30">
<list key="parameters">
<parameter key="Windowing.label_attribute" value="single_price,single_price2,single_price3"/>
</list>
<process expanded="true" height="390" width="743">
<operator activated="true" class="series:windowing" compatibility="5.1.002" expanded="true" height="76" name="Windowing (2)" width="90" x="45" y="165">
<parameter key="window_size" value="1"/>
</operator>
<operator activated="true" class="series:windowing" compatibility="5.1.002" expanded="true" height="76" name="Windowing" width="90" x="45" y="30">
<parameter key="horizon" value="1"/>
<parameter key="window_size" value="1"/>
<parameter key="create_label" value="true"/>
<parameter key="label_attribute" value="single_price3"/>
</operator>
<operator activated="true" class="series:sliding_window_validation" compatibility="5.1.002" expanded="true" height="112" name="Validation" width="90" x="179" y="30">
<parameter key="training_window_width" value="20"/>
<parameter key="training_window_step_size" value="5"/>
<parameter key="test_window_width" value="20"/>
<parameter key="horizon" value="5"/>
<process expanded="true">
<operator activated="true" class="support_vector_machine" compatibility="5.2.007" expanded="true" name="SVM"/>
<connect from_port="training" to_op="SVM" to_port="training set"/>
<connect from_op="SVM" from_port="model" to_port="model"/>
<portSpacing port="source_training" spacing="0"/>
<portSpacing port="sink_model" spacing="0"/>
<portSpacing port="sink_through 1" spacing="0"/>
</process>
<process expanded="true">
<operator activated="true" class="apply_model" compatibility="5.2.007" expanded="true" name="Apply Model">
<list key="application_parameters"/>
</operator>
<operator activated="true" class="series:forecasting_performance" compatibility="5.1.002" expanded="true" name="Performance">
<parameter key="horizon" value="1"/>
</operator>
<connect from_port="model" to_op="Apply Model" to_port="model"/>
<connect from_port="test set" to_op="Apply Model" to_port="unlabelled data"/>
<connect from_op="Apply Model" from_port="labelled data" to_op="Performance" to_port="labelled data"/>
<connect from_op="Performance" from_port="performance" to_port="averagable 1"/>
<portSpacing port="source_model" spacing="0"/>
<portSpacing port="source_test set" spacing="0"/>
<portSpacing port="source_through 1" spacing="0"/>
<portSpacing port="sink_averagable 1" spacing="0"/>
<portSpacing port="sink_averagable 2" spacing="0"/>
</process>
</operator>
<operator activated="true" class="apply_model" compatibility="5.2.007" expanded="true" height="76" name="Apply Model (2)" width="90" x="313" y="120">
<list key="application_parameters"/>
</operator>
<operator activated="true" class="generate_attributes" compatibility="5.2.007" expanded="true" height="76" name="Generate Attributes" width="90" x="447" y="120">
<list key="function_descriptions">
<parameter key="label_attribute" value="param("Windowing", "label_attribute")"/>
</list>
</operator>
<connect from_port="input 1" to_op="Windowing" to_port="example set input"/>
<connect from_port="input 2" to_op="Windowing (2)" to_port="example set input"/>
<connect from_op="Windowing (2)" from_port="example set output" to_op="Apply Model (2)" to_port="unlabelled data"/>
<connect from_op="Windowing" from_port="example set output" to_op="Validation" to_port="training"/>
<connect from_op="Validation" from_port="model" to_op="Apply Model (2)" to_port="model"/>
<connect from_op="Apply Model (2)" from_port="labelled data" to_op="Generate Attributes" to_port="example set input"/>
<connect from_op="Generate Attributes" from_port="example set output" to_port="result 1"/>
<portSpacing port="source_input 1" spacing="0"/>
<portSpacing port="source_input 2" spacing="0"/>
<portSpacing port="source_input 3" spacing="0"/>
<portSpacing port="sink_performance" spacing="72"/>
<portSpacing port="sink_result 1" spacing="0"/>
<portSpacing port="sink_result 2" spacing="0"/>
</process>
</operator>
<operator activated="true" class="append" compatibility="5.2.007" expanded="true" height="76" name="Append" width="90" x="447" y="30"/>
<operator activated="true" breakpoints="after" class="select_attributes" compatibility="5.2.007" expanded="true" height="76" name="Select Attributes (2)" width="90" x="581" y="30">
<parameter key="attribute_filter_type" value="subset"/>
<parameter key="attributes" value="prediction(label)|label_attribute||date"/>
</operator>
<operator activated="true" class="set_role" compatibility="5.2.007" expanded="true" height="76" name="Set Role (2)" width="90" x="648" y="210">
<parameter key="name" value="date"/>
<list key="set_additional_roles">
<parameter key="prediction(label)" value="regular"/>
</list>
</operator>
<operator activated="true" class="pivot" compatibility="5.2.007" expanded="true" height="76" name="Pivot" width="90" x="715" y="30">
<parameter key="group_attribute" value="date"/>
<parameter key="index_attribute" value="label_attribute"/>
<parameter key="consider_weights" value="false"/>
</operator>
<connect from_op="Subprocess" from_port="out 1" to_op="Multiply" to_port="input"/>
<connect from_op="Multiply" from_port="output 1" to_op="Loop Parameters" to_port="input 1"/>
<connect from_op="Multiply" from_port="output 2" to_op="Loop Parameters" to_port="input 2"/>
<connect from_op="Loop Parameters" from_port="result 1" to_op="Append" to_port="example set 1"/>
<connect from_op="Append" from_port="merged set" to_op="Select Attributes (2)" to_port="example set input"/>
<connect from_op="Select Attributes (2)" from_port="example set output" to_op="Set Role (2)" to_port="example set input"/>
<connect from_op="Set Role (2)" from_port="example set output" to_op="Pivot" to_port="example set input"/>
<connect from_op="Pivot" from_port="example set output" 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>
Nils0