Skip to content

Instantly share code, notes, and snippets.

@NMZivkovic
Created July 1, 2018 16:18
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 NMZivkovic/d03534e36acb65576650e8e36a429fae to your computer and use it in GitHub Desktop.
Save NMZivkovic/d03534e36acb65576650e8e36a429fae to your computer and use it in GitHub Desktop.
public class ModelEvaluator
{
/// <summary>
/// Ussing passed testing data and model, it calculates model's accuracy.
/// </summary>
/// <returns>Accuracy of the model.</returns>
public BinaryClassificationMetrics Evaluate(PredictionModel<WineQualitySample, WineQualityPrediction> model, string testDataLocation)
{
var testData = new TextLoader(testDataLocation).CreateFrom<WineQualitySample>(useHeader: true, separator: ';');
var metrics = new BinaryClassificationEvaluator().Evaluate(model, testData);
return metrics;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment