I selected Text Classification in Model Builder and was able to evaluate the model with sample data. I get multiple results rows with percent accuracy in Visual Studio plugin like below:
Results
Result1 60%
Result2 5%
Result3 <1%
Result4 <1%
Result5 <1%
However when using the generated model code I only get one prediction result using
var predictionResult = ConsumeModel.Predict(input);
Question: How do I use the generated model to return multiple prediction results with percentage accuracy for one model input? Similar to how model builder displays in the Evaluate step in Visual Studio plugin.
The easiest way is to base it on what Score returns and match it with the Label name in the Dataset folder. Then use comparison to rearrange the order of results received.
For example in Dataset Animals below:
(Image) Convert scores to Label name
You can put it in a 2-dimensional array and sort it. Finally, you get the result as below.
You can refer to the following 2-dimensional array sort code, it will sort Score and keep your LabelName.
Now, you can use the loop to retrieve the results and present them the way you want.