Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
static void Main(string[] args)
{
var regressors = new List<ITrainerEstimator<ISingleFeaturePredictionTransformer<IPredictor>, IPredictor>>()
{
_mlContext.Regression.Trainers.FastForest(labelColumn: "Count", featureColumn: "Features"),
_mlContext.Regression.Trainers.FastTree(labelColumn: "Count", featureColumn: "Features"),
_mlContext.Regression.Trainers.FastTreeTweedie(labelColumn: "Count", featureColumn: "Features"),
_mlContext.Regression.Trainers.GeneralizedAdditiveModels(labelColumn: "Count", featureColumn: "Features"),
_mlContext.Regression.Trainers.OnlineGradientDescent(labelColumn: "Count", featureColumn: "Features"),
_mlContext.Regression.Trainers.PoissonRegression(labelColumn: "Count", featureColumn: "Features"),
_mlContext.Regression.Trainers.StochasticDualCoordinateAscent(labelColumn: "Count", featureColumn: "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