예제 #1
0
        private static void EvaluateTestSinglePredictionMLdotnet(MLContext mlc, ITransformer m)
        {
            var predictionFunction = mlc
                                     .Model
                                     .CreatePredictionEngine <SomatotypeInputData, SomatotypeOutputData>(m);


            SomatotypeOutputData prediction = predictionFunction.Predict(sample_ml);

            Console.WriteLine($"**********************************************************************");
            Console.WriteLine($"Predicted fare: {prediction.EndomorphicComponent:0.####}, actual fare: XXXXXXXXXX");
            Console.WriteLine($"**********************************************************************");

            return;
        }
예제 #2
0
        public static void EvaluateSingleTestPrediction(SomatotypeInputData input)
        {
            PredictionEngine <SomatotypeInputData, SomatotypeOutputData> prediction_engine = null;

            prediction_engine = Data.Context
                                .Model
                                .CreatePredictionEngine <SomatotypeInputData, SomatotypeOutputData>(Data.Transformer);


            SomatotypeOutputData prediction = prediction_engine.Predict(input);

            Console.WriteLine($"**********************************************************************");
            Console.WriteLine($"Predicted Endomorphic: {prediction.EndomorphicComponent:0.####}, actual fare: XXXXXXXXXX");
            Console.WriteLine($"**********************************************************************");

            return;
        }