Skip to content

Instantly share code, notes, and snippets.

@NMZivkovic
Created July 12, 2019 14:03
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/bc81c1d2741b3eb3210fb85a2b31c437 to your computer and use it in GitHub Desktop.
Save NMZivkovic/bc81c1d2741b3eb3210fb85a2b31c437 to your computer and use it in GitHub Desktop.
static void Main(string[] args)
{
var regressors = new List<IEstimator<ITransformer>>()
{
_mlContext.Regression.Trainers.Sdca(labelColumnName: "Count", featureColumnName: "Features"),
_mlContext.Regression.Trainers.LbfgsPoissonRegression(labelColumnName: "Count", featureColumnName: "Features"),
_mlContext.Regression.Trainers.FastForest(labelColumnName: "Count", featureColumnName: "Features"),
_mlContext.Regression.Trainers.FastTree(labelColumnName: "Count", featureColumnName: "Features"),
_mlContext.Regression.Trainers.FastTreeTweedie(labelColumnName: "Count", featureColumnName: "Features"),
_mlContext.Regression.Trainers.Gam(labelColumnName: "Count", featureColumnName: "Features")
};
regressors.ForEach(RunAlgorythm);
var bestModel = _stats.Where(x => x.Value == _stats.Max(y => y.Value)).Single().Key;
VisualizeTenPredictionsForTheModel(bestModel);
bestModel.SaveModel();
Console.ReadLine();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment