static async Task Main(string[] args) { try { ProductModelHelper.TrainAndSaveModel("data/products.stats.csv"); ProductModelHelper.TestPrediction(); CountryModelHelper.TrainAndSaveModel("data/countries.stats.csv"); CountryModelHelper.TestPrediction(); } catch (Exception ex) { ConsoleWriteException(ex.Message); } ConsolePressAnyKey(); }
static void Main(string[] args) { try { MLContext mlContext = new MLContext(seed: 1); //Seed set to any number so you have a deterministic environment ProductModelHelper.TrainAndSaveModel(mlContext, ProductDataPath); ProductModelHelper.TestPrediction(mlContext); CountryModelHelper.TrainAndSaveModel(mlContext, CountryDataPath); CountryModelHelper.TestPrediction(mlContext); } catch (Exception ex) { ConsoleWriteException(ex.Message); } ConsolePressAnyKey(); }
static async Task Main(string[] args) { try { await ProductModelHelper.TrainAndSaveModel("data/products.stats.csv"); await ProductModelHelper.TestPrediction(); await CountryModelHelper.TrainAndSaveModel("data/countries.stats.csv"); await CountryModelHelper.TestPrediction(); Console.Write("Hit any key to exit"); Console.ReadLine(); } catch (Exception ex) { Console.Write(ex.Message); } }