[SOLVED] Set label to attribute name...

EquationDocEquationDoc Member Posts: 2 Contributor I
edited November 2018 in Help
Let's say I have an example set with a label attribute (initially blank) and some reals...maybe:
Now for each row, I want to set the Label to be the name of the attribute where the maximal real value occurs, which for the current example would yield:
I have implemented this by aggregating the max of the reals into a new attribute called Max, then looping over attributes, then looping over examples, and seeing if the value is equal to the value stored in Max, and if so using Set Data to store the attribute name in Label.

That works, but I've got O(100) reals and O(1,000) examples, so you can imagine how SSSSSLLLLLLOOOOOOOWWWWWWW it is. Ssssooooo....

The question is, is there  a better and faster way to do this?

Any ideas/help would be most appreciated!



  • Options
    EquationDocEquationDoc Member Posts: 2 Contributor I
    Ugh. Never mind. Pay no attention to the newb.

    One of the attributes that was not part of the processing was a text attribute from a Process Documents (via a checked "keep text") that contained news articles of size O(10K) to O(100K), and presumably there were copies being made in the process of looping and/or filtering.

    Once I got rid of that attribute by unchecking "keep text" things sped up considerably (runtime of 2m 47s decreased to 13s).

    Ancient wisdom learned anew: Entia non sunt multiplicanda praeter necessitatem.

Sign In or Register to comment.