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
Count a specific number in a set of attributes
Hi,
I have a set of attributes and I need to create a new attribute which counts the number of zeros appearing in all the rows over the set of attributes.
I tried some like the below.
Though the AttrbuteAggregation operator has the COUNT function, it cannot count the occurance of a specific number over the set of attributes.
Thanks for your help,
Shubha
I have a set of attributes and I need to create a new attribute which counts the number of zeros appearing in all the rows over the set of attributes.
I tried some like the below.
<operator name="Root" class="Process" expanded="yes">
<operator name="ExampleSetGenerator" class="ExampleSetGenerator">
<parameter key="target_function" value="random"/>
<parameter key="number_examples" value="10"/>
</operator>
<operator name="Real2Integer" class="Real2Integer">
<parameter key="round" value="true"/>
</operator>
<operator name="AttributeAggregation" class="AttributeAggregation" breakpoints="before">
<parameter key="attribute_name" value="new"/>
<parameter key="aggregation_attributes" value="att.*"/>
<parameter key="aggregation_function" value="count"/>
</operator>
</operator>
Though the AttrbuteAggregation operator has the COUNT function, it cannot count the occurance of a specific number over the set of attributes.
Thanks for your help,
Shubha
0
Answers
Nice problem for regex folk! Does this do what you want? Haven't checked it thoroughly, but you get the idea.. Good weekend to all!
PS Last edit I think covers most cases, also last version only worked on enterprise, as it used numerica2formattednominal, using numerica2polynominal seems to work OK.
Shubha