Collection: count atrtibutes in each object
s_nektarijevic
New Altair Community Member
Dear all,
I run a process in which I create a small example set in each iteration of a loop, and merge them all in the end using the Append operator
However, somewhere in the process something goes wrong and apparently some iteration ends up creating an example set with a different number of attributes, so the append operator crashes,
Now, I want to debug this and I stored the entire collection. However I have ~70 k objects in the collection and I cannot look through them by eye. I was wandering whether there was an operator that returns the number of attributes in an example set, such that I can compute it for all objects in the collection and hopefully quickly spot where the problem is?
I didn't manage to find anything useful myself, so any input from you is valuable!
Cheers,
Snežana
Tagged:
0
Best Answer
-
Hi @s_nektarijevic,
You can use the Extract Macro operator, which can directly extract the number of attributes of an ExampleSet. Use the operator Create ExampleSet (or Generate Data by User Specification if you are on RM 9.1 or below) with eval(%{macro_name}) to get the number in a new ExampleSet-
Best regards,
Fabian5
Answers
-
Hi @s_nektarijevic,
You can use the Extract Macro operator, which can directly extract the number of attributes of an ExampleSet. Use the operator Create ExampleSet (or Generate Data by User Specification if you are on RM 9.1 or below) with eval(%{macro_name}) to get the number in a new ExampleSet-
Best regards,
Fabian5 -
Thanks a lot @tftemme !!! This worked!1