Description
CONTEXT:
In this PR (and probably, available in 0.10), we're allowing the user to get some schema info after predicting:
That way a user can get, for example, get the list of the predicted labels in a multi-class classification and related that to the list/array of scores.
That's very useful for business cases where you want to automatically predict/assign a product to multiple categories, for example, instead of predicting a single category/label.
However, the current user's code needs to be like the following, using not user-friendly types such as VBuffer, etc.:
// Slot names on top of Score column represent original labels for i-th value in Score array.
VBuffer<ReadOnlyMemory<char>> slotNames = default;
engine.OutputSchema[nameof(IrisPrediction.Score)].GetSlotNames(ref slotNames);
// Key names represent original values for PredictedLabel column.
VBuffer<ReadOnlyMemory<char>> keys = default;
engine.OutputSchema[nameof(IrisPrediction.PredictedLabel)].GetKeyValues(ref keys);
Assert.True(slotNames.GetItemOrDefault(0).ToString() == "Iris-setosa");
Assert.True(slotNames.GetItemOrDefault(1).ToString() == "Iris-versicolor");
Assert.True(slotNames.GetItemOrDefault(2).ToString() == "Iris-virginica");
REQUEST:
The ask is to simplify it and provide types and simpler API with user-friendly data-types that are familiar for regular .NET developers.
Also, a more straightforward way to relate the list of labels with their related scores. Maybe returning a single array/list with both concepts coming along (labels-scores) instead of separated arrays/lists?
Related info
This topic is related with this original issue, too:
Multi-class classification returning ranked list of possible labels): #2233