Created
December 3, 2019 14:46
-
-
Save icebeam7/edac22dbcb16d32b34edb0d066a4a5c5 to your computer and use it in GitHub Desktop.
MovieRecommender: EvaluateModel code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void EvaluateModel(MLContext mlContext, IDataView testDataView, ITransformer model) | |
{ | |
Console.WriteLine("=============== Evaluating the model ==============="); | |
var prediction = model.Transform(testDataView); | |
var metrics = mlContext.Regression.Evaluate(prediction, labelColumnName: "Label", scoreColumnName: "Score"); | |
Console.WriteLine("Root Mean Squared Error : " + metrics.RootMeanSquaredError.ToString()); | |
Console.WriteLine("RSquared: " + metrics.RSquared.ToString()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment