Skip to content

Instantly share code, notes, and snippets.

@icebeam7
Created December 3, 2019 14:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save icebeam7/edac22dbcb16d32b34edb0d066a4a5c5 to your computer and use it in GitHub Desktop.
Save icebeam7/edac22dbcb16d32b34edb0d066a4a5c5 to your computer and use it in GitHub Desktop.
MovieRecommender: EvaluateModel code
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