The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here
Transpose by a Column
Hi,
Can I transpose an exampleset (data) by a group variable? Because i see no options in the 'ExampleSetTranspose' to give parameters like a do transpose 'by' a variable. This operator tranposes the whole data. Instead, can we specify the variable by which we need the transpose?
For example, in the below code I wanted to transpose the data by the 'Group' variable.
<operator name="Root" class="Process" expanded="yes">
<operator name="ExampleSetGenerator" class="ExampleSetGenerator">
<parameter key="target_function" value="random"/>
<parameter key="number_examples" value="10"/>
<parameter key="number_of_attributes" value="1"/>
</operator>
<operator name="AttributeConstruction" class="AttributeConstruction">
<list key="function_descriptions">
<parameter key="Group" value="if(att1>0,1,0)"/>
</list>
</operator>
<operator name="ExampleSetTranspose" class="ExampleSetTranspose">
</operator>
</operator>
Please let me know if the question is unclear. It is just like 'PROC TRANSPOSE... by var" in SAS. Or if there is any other operator for this purpose?
Many thanks for your help,
Shubha
Can I transpose an exampleset (data) by a group variable? Because i see no options in the 'ExampleSetTranspose' to give parameters like a do transpose 'by' a variable. This operator tranposes the whole data. Instead, can we specify the variable by which we need the transpose?
For example, in the below code I wanted to transpose the data by the 'Group' variable.
<operator name="Root" class="Process" expanded="yes">
<operator name="ExampleSetGenerator" class="ExampleSetGenerator">
<parameter key="target_function" value="random"/>
<parameter key="number_examples" value="10"/>
<parameter key="number_of_attributes" value="1"/>
</operator>
<operator name="AttributeConstruction" class="AttributeConstruction">
<list key="function_descriptions">
<parameter key="Group" value="if(att1>0,1,0)"/>
</list>
</operator>
<operator name="ExampleSetTranspose" class="ExampleSetTranspose">
</operator>
</operator>
Please let me know if the question is unclear. It is just like 'PROC TRANSPOSE... by var" in SAS. Or if there is any other operator for this purpose?
Many thanks for your help,
Shubha
0
Answers
Group X1
1 40
1 70
1 70
1 58
1 45
2 45
2 63
2 62
2 47
2 59
3 65
3 43
3 46
3 40
3 70
4 40
4 64
4 44
4 50
4 58
The resultant exampleset after transposing by the 'group' variable should look like:
Group att1 att2 att3 att4 att5
1 40 70 70 58 45
2 45 63 62 47 59
3 65 43 46 40 70
4 40 64 44 50 58
Thanks in advance,
Shubha
Cheers,
Ingo
Not sure what the real point of this endless list of questions from Shubha is, but here is an answer to the last one, just to make the point. Not sure I'll bother much more.
If I can dig this thread again, may I know where is the operator "Example2AttributePivoting"?
Thanks,
Shubha