Closed muhamedkarajic closed 2 months ago
The issue was the following code which was generated by ML.NET:
mlContext.MulticlassClassification.Trainers.OneVersusAll(binaryEstimator:mlContext.BinaryClassification.Trainers.FastTree(...)"}),labelColumnName: @"target");
I assumed this is outputting a BinaryClassification while its actually MulticlassClassification. I have quickly solved it by doing:
var metrics = mlContext.MulticlassClassification.Evaluate(predictedData, "target", "Score", "PredictedLabel");
System Information (please complete the following information):
Describe the bug I want to split the training and test set and evaluate the model. Therefor I have created a function:
To Reproduce Steps to reproduce the behavior:
mlnet classification --dataset "./FILE_PATH/FILE_NAME.csv" --label-col 11 --has-header true --train-time 60
SampleClassification.training.cs
the functionEvaluateModel
Train
function bydotnet run
An unhandled exception of type 'System.ArgumentOutOfRangeException' occurred in Microsoft.ML.Data.dll: 'Schema mismatch for score column 'Score': expected Single, got Vector<Single, 2>'
Expected behavior I would expect the code to work since the Score is something which ML.NET creates. It seems like it expects the score to be a sinle value while its a compex vector.
Screenshots, Code, Sample Projects
Here is the adjusted train function:
Additional context I ahve found that I am supposed to use
EvaluateNonCalibrated
instead ofEvaluate
. Have similar when usingEvaluate
its says that its missing Predictions. Error in that caseProbability column 'Probability' not found (Parameter 'schema')
.