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
How does MultipleLabelIterator work? How to apply resulting model(s)?
Legacy User
Member Posts: 0 Newbie
The MultipleLabelIterator applies its inner operator multiple times, changing the label each time. When used with a learning function, the learner is thus trained on each of the multiple labels.
Is the result a single model than can somehow be used to attached multiple labels to new data? If so, how? Or are we required to save each inner-loop model, then reload them to use them on new data?
--Gary
0
Answers
If called from code, how do you 'reach into' the MultipleLabelIterator operator to retrieve each example set prediction/confidence as it applies the labels?
Thanks,
Gary
Here's some scrap code to illustrate the approach.
Further questions for haddock and others:
I notice that you used an IteratingOperator instead of the MultipleLabelIterator. In doing so, you create the changing attribute names with macros. In contrast, the MultipleLabelIterator changes the attribute name automatically. Is there a way to retrieve the attribute name used by the MultipleLabelIterator for the label? In particular, how can we get the name of the prediction attribute? Your example constructs the name. Seems like there should be a way to get the name from the attribute with the type 'label'.
I also see that you store the results in the database as they are generated. Is there a way to accumulate them, adding prediction/confidence columns onto the dataset? So the end result would look like the dataset used to train with MultipleLabelIterator. Alternatively, I see that the MultipleLabelIterator is designed to accumulate result items; how do we make the predictions into a result set that MultipleLabelIterator can retain?
Thanks again, haddock.
Gary
Is there a way to retain the prediction column that's added onto the dataset by ModelApplier inside the MultipleLabelIterator? Could we keep the whole ExampleSet, so that at the end of the loop, all of the extra columns remain?
Hey, found a solution!
It turns out that IOStorer will cause the example sets to accumulate. So I told the Performance-testing operator to keep the exampleSet, then filtered out all the non-special numerical attributes. That left the ids, the labels, and the predictions/confidences. So I filtered out the special attributes of form 'label_*'. That left just the ids and predictions/confidences. Adding an IOStorer caused these stripped-down example sets to be retained to the very end, along with the final Averaged performance. I didn't even have to use any IORetrievers. The final result is an example set of ids and predictions for each label in the multilabel data.
Please let me know if there's a simpler or preferred way to do this.
--Gary
Actually I think that all the work is done by the feature filters, like this.. You still end up with separate example sets because the name of the label is not extracted, and I'm not sure it can be when the MultiLabelIterator is used. However, all is not lost because you can transpose the examples to expose the label names, and then iterate over them instead, like this....
Transpose, then use filter out everything but the labels. Then iterate over those.
Very smart! Good technique to know!
Gary