static async Task Main(string[] args) { PredictionModel <Abalone, AbaloneAgePrediction> model = await Train(); Abalone abalone1 = new Abalone { Lenght = 0.524f, Diameter = 0.408f, Height = 0.140f, WholeWeight = 0.829f, ShellWeight = 0.239f, Age = 0, }; Abalone abalone2 = new Abalone { Lenght = 0.455f, Diameter = 0.365f, Height = 0.095f, WholeWeight = 0.514f, ShellWeight = 0.15f, Age = 0, }; var prediction = model.Predict(abalone1); Console.WriteLine(string.Format("Predicted Age is {0}", Math.Floor(prediction.Age))); prediction = model.Predict(abalone2); Console.WriteLine(string.Format("Predicted Age is {0}", Math.Floor(prediction.Age))); Console.ReadLine(); }
static void YMain(string[] args) { Task.Run(() => { PredictionModel <Abalone, AbaloneAgePrediction> model = Train().Result; Abalone abalone1 = new Abalone() { Lenght = 0.524f, Diameter = 0.408f, Height = 0.140f, WholeWeight = 0.829f, ShellWeight = 0.239f, Age = 0, }; var prediction = model.Predict(abalone1); Console.WriteLine("Predicted Age is {0}", Math.Floor(prediction.Age)); }); Console.ReadLine(); }