Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@NMZivkovic
Created June 23, 2018 12:54
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/33fac1263cf8a902a18a3f4967fe2a86 to your computer and use it in GitHub Desktop.
Save NMZivkovic/33fac1263cf8a902a18a3f4967fe2a86 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 RegressionMetrics Evaluate(PredictionModel<BikeSharingDemandSample, BikeSharingDemandPrediction> model, string testDataLocation)
{
var testData = new TextLoader(testDataLocation).CreateFrom<BikeSharingDemandSample>(useHeader: true, separator: ',');
var metrics = new RegressionEvaluator().Evaluate(model, testData);
return metrics;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment