Exemple #1
0
        public Model(MLContext mlContext, ITrainerEstimator <ISingleFeaturePredictionTransformer <IPredictor>, IPredictor> algorythm)
        {
            _mlContext  = mlContext;
            _algorythim = algorythm;

            _textLoader = _mlContext.Data.CreateTextLoader(new TextLoader.Arguments()
            {
                Separators = new[] { ';' },
                HasHeader  = true,
                Column     = new[]
                {
                    new TextLoader.Column("FixedAcidity", DataKind.R4, 0),
                    new TextLoader.Column("VolatileAcidity", DataKind.R4, 1),
                    new TextLoader.Column("CitricAcid", DataKind.R4, 2),
                    new TextLoader.Column("ResidualSugar", DataKind.R4, 3),
                    new TextLoader.Column("Chlorides", DataKind.R4, 4),
                    new TextLoader.Column("FreeSulfurDioxide", DataKind.R4, 5),
                    new TextLoader.Column("TotalSulfurDioxide", DataKind.R4, 6),
                    new TextLoader.Column("Density", DataKind.R4, 7),
                    new TextLoader.Column("Ph", DataKind.R4, 8),
                    new TextLoader.Column("Sulphates", DataKind.R4, 9),
                    new TextLoader.Column("Alcohol", DataKind.R4, 10),
                    new TextLoader.Column("Label", DataKind.Text, 11)
                }
            });

            Name = algorythm.GetType().ToString().Split('.').Last();
        }
Exemple #2
0
        private static void RunAlgorythm(ITrainerEstimator <ISingleFeaturePredictionTransformer <IPredictor>, IPredictor> algorythm)
        {
            var model = new Model(_mlContext, algorythm);

            model.BuildAndFit(_trainingDataLocation);
            PrintAndStoreMetrics(model);
        }
Exemple #3
0
        public Model(MLContext mlContext, ITrainerEstimator <ISingleFeaturePredictionTransformer <IPredictor>, IPredictor> algorythm)
        {
            _mlContext  = mlContext;
            _algorythim = algorythm;
            _textLoader = _mlContext.Data.CreateTextLoader(new TextLoader.Arguments()
            {
                Separators = new[] { ',' },
                HasHeader  = true,
                Column     = new[]
                {
                    new TextLoader.Column("Season", DataKind.R4, 2),
                    new TextLoader.Column("Year", DataKind.R4, 3),
                    new TextLoader.Column("Month", DataKind.R4, 4),
                    new TextLoader.Column("Hour", DataKind.R4, 5),
                    new TextLoader.Column("Holiday", DataKind.Bool, 6),
                    new TextLoader.Column("Weekday", DataKind.R4, 7),
                    new TextLoader.Column("Weather", DataKind.R4, 8),
                    new TextLoader.Column("Temperature", DataKind.R4, 9),
                    new TextLoader.Column("NormalizedTemperature", DataKind.R4, 10),
                    new TextLoader.Column("Humidity", DataKind.R4, 11),
                    new TextLoader.Column("Windspeed", DataKind.R4, 12),
                    new TextLoader.Column("Count", DataKind.R4, 16),
                }
            });

            Name = algorythm.GetType().ToString().Split('.').Last();
        }
 /// <summary>
 /// Predicts a target using a linear multiclass classification model trained with the <see cref="Pkpd"/>.
 /// </summary>
 /// <remarks>
 /// <para>
 /// In the Pairwise coupling (PKPD) strategy, a binary classification algorithm is used to train one classifier for each pair of classes.
 /// Prediction is then performed by running these binary classifiers, and computing a score for each class by counting how many of the binary
 /// classifiers predicted it. The prediction is the class with the highest score.
 /// </para>
 /// </remarks>
 /// <param name="ctx">The <see cref="MulticlassClassificationContext.MulticlassClassificationTrainers"/>.</param>
 /// <param name="binaryEstimator">An instance of a binary <see cref="ITrainerEstimator{TTransformer, TPredictor}"/> used as the base trainer.</param>
 /// <param name="calibrator">The calibrator. If a calibrator is not explicitely provided, it will default to <see cref="PlattCalibratorTrainer"/></param>
 /// <param name="labelColumn">The name of the label colum.</param>
 /// <param name="imputeMissingLabelsAsNegative">Whether to treat missing labels as having negative labels, instead of keeping them missing.</param>
 /// <param name="maxCalibrationExamples">Number of instances to train the calibrator.</param>
 public static Pkpd PairwiseCoupling(this MulticlassClassificationContext.MulticlassClassificationTrainers ctx,
                                     ITrainerEstimator <ISingleFeaturePredictionTransformer <IPredictorProducing <float> >, IPredictorProducing <float> > binaryEstimator,
                                     string labelColumn = DefaultColumnNames.Label,
                                     bool imputeMissingLabelsAsNegative = false,
                                     ICalibratorTrainer calibrator      = null,
                                     int maxCalibrationExamples         = 1000000000)
 {
     Contracts.CheckValue(ctx, nameof(ctx));
     return(new Pkpd(CatalogUtils.GetEnvironment(ctx), binaryEstimator, labelColumn, imputeMissingLabelsAsNegative, calibrator, maxCalibrationExamples));
 }
Exemple #5
0
 /// <summary>
 /// Predicts a target using a linear multiclass classification model trained with the <see cref="Ova"/>.
 /// </summary>
 /// <remarks>
 /// <para>
 /// In <see cref="Ova"/> In this strategy, a binary classification algorithm is used to train one classifier for each class,
 /// which distinguishes that class from all other classes. Prediction is then performed by running these binary classifiers,
 /// and choosing the prediction with the highest confidence score.
 /// </para>
 /// </remarks>
 /// <param name="catalog">The <see cref="MulticlassClassificationCatalog.MulticlassClassificationTrainers"/>.</param>
 /// <param name="binaryEstimator">An instance of a binary <see cref="ITrainerEstimator{TTransformer, TPredictor}"/> used as the base trainer.</param>
 /// <param name="calibrator">The calibrator. If a calibrator is not explicitely provided, it will default to <see cref="PlattCalibratorTrainer"/></param>
 /// <param name="labelColumn">The name of the label colum.</param>
 /// <param name="imputeMissingLabelsAsNegative">Whether to treat missing labels as having negative labels, instead of keeping them missing.</param>
 /// <param name="maxCalibrationExamples">Number of instances to train the calibrator.</param>
 /// <param name="useProbabilities">Use probabilities (vs. raw outputs) to identify top-score category.</param>
 public static Ova OneVersusAll(this MulticlassClassificationCatalog.MulticlassClassificationTrainers catalog,
                                ITrainerEstimator <ISingleFeaturePredictionTransformer <IPredictorProducing <float> >, IPredictorProducing <float> > binaryEstimator,
                                string labelColumn = DefaultColumnNames.Label,
                                bool imputeMissingLabelsAsNegative = false,
                                ICalibratorTrainer calibrator      = null,
                                int maxCalibrationExamples         = 1000000000,
                                bool useProbabilities = true)
 {
     Contracts.CheckValue(catalog, nameof(catalog));
     return(new Ova(CatalogUtils.GetEnvironment(catalog), binaryEstimator, labelColumn, imputeMissingLabelsAsNegative, calibrator, maxCalibrationExamples, useProbabilities));
 }
Exemple #6
0
        /// <summary>
        /// Predicts a target using a linear multiclass classification model trained with the <see cref="Pkpd"/>.
        /// </summary>
        /// <remarks>
        /// <para>
        /// In the Pairwise coupling (PKPD) strategy, a binary classification algorithm is used to train one classifier for each pair of classes.
        /// Prediction is then performed by running these binary classifiers, and computing a score for each class by counting how many of the binary
        /// classifiers predicted it. The prediction is the class with the highest score.
        /// </para>
        /// </remarks>
        /// <param name="catalog">The <see cref="MulticlassClassificationCatalog.MulticlassClassificationTrainers"/>.</param>
        /// <param name="binaryEstimator">An instance of a binary <see cref="ITrainerEstimator{TTransformer, TPredictor}"/> used as the base trainer.</param>
        /// <param name="calibrator">The calibrator. If a calibrator is not explicitely provided, it will default to <see cref="PlattCalibratorTrainer"/></param>
        /// <param name="labelColumn">The name of the label colum.</param>
        /// <param name="imputeMissingLabelsAsNegative">Whether to treat missing labels as having negative labels, instead of keeping them missing.</param>
        /// <param name="maxCalibrationExamples">Number of instances to train the calibrator.</param>
        /// <typeparam name="TModel">The type of the model. This type parameter will usually be inferred automatically from <paramref name="binaryEstimator"/>.</typeparam>
        public static Pkpd PairwiseCoupling <TModel>(this MulticlassClassificationCatalog.MulticlassClassificationTrainers catalog,
                                                     ITrainerEstimator <ISingleFeaturePredictionTransformer <TModel>, TModel> binaryEstimator,
                                                     string labelColumn = DefaultColumnNames.Label,
                                                     bool imputeMissingLabelsAsNegative = false,
                                                     IEstimator <ISingleFeaturePredictionTransformer <ICalibrator> > calibrator = null,
                                                     int maxCalibrationExamples = 1_000_000_000)
            where TModel : class
        {
            Contracts.CheckValue(catalog, nameof(catalog));
            var env = CatalogUtils.GetEnvironment(catalog);

            if (!(binaryEstimator is ITrainerEstimator <ISingleFeaturePredictionTransformer <IPredictorProducing <float> >, IPredictorProducing <float> > est))
            {
                throw env.ExceptParam(nameof(binaryEstimator), "Trainer estimator does not appear to produce the right kind of model.");
            }
            return(new Pkpd(env, est, labelColumn, imputeMissingLabelsAsNegative, GetCalibratorTrainerOrThrow(env, calibrator), maxCalibrationExamples));
        }
Exemple #7
0
        private void TestFeatureContribution(
            ITrainerEstimator <ISingleFeaturePredictionTransformer <ICalculateFeatureContribution>, ICalculateFeatureContribution> trainer,
            IDataView data,
            string testFile,
            int precision = 6)
        {
            // Train the model.
            var model = trainer.Fit(data);

            // Calculate feature contributions.
            var est = ML.Transforms.CalculateFeatureContribution(model, numberOfPositiveContributions: 3, numberOfNegativeContributions: 0)
                      .Append(ML.Transforms.CalculateFeatureContribution(model, numberOfPositiveContributions: 0, numberOfNegativeContributions: 3))
                      .Append(ML.Transforms.CalculateFeatureContribution(model, numberOfPositiveContributions: 1, numberOfNegativeContributions: 1))
                      .Append(ML.Transforms.CalculateFeatureContribution(model, numberOfPositiveContributions: 1, numberOfNegativeContributions: 1, normalize: false));

            TestEstimatorCore(est, data);

            // Verify output.
            CheckOutput(est, data, testFile, precision);
            Done();
        }
        private void TestFeatureContribution(
            ITrainerEstimator <ISingleFeaturePredictionTransformer <IPredictor>, IPredictor> trainer,
            IDataView data,
            string testFile,
            int precision = 6)
        {
            // Train the model.
            var model = trainer.Fit(data);

            // Extract the predictor, check that it supports feature contribution.
            var predictor = model.Model as ICalculateFeatureContribution;

            Assert.NotNull(predictor);

            // Calculate feature contributions.
            var est = new FeatureContributionCalculatingEstimator(ML, predictor, "Features", numPositiveContributions: 3, numNegativeContributions: 0)
                      .Append(new FeatureContributionCalculatingEstimator(ML, predictor, "Features", numPositiveContributions: 0, numNegativeContributions: 3))
                      .Append(new FeatureContributionCalculatingEstimator(ML, predictor, "Features", numPositiveContributions: 1, numNegativeContributions: 1))
                      .Append(new FeatureContributionCalculatingEstimator(ML, predictor, "Features", numPositiveContributions: 1, numNegativeContributions: 1, normalize: false));

            TestEstimatorCore(est, data);
            // Verify output.
            var outputPath = GetOutputPath("FeatureContribution", testFile + ".tsv");

            using (var ch = Env.Start("save"))
            {
                var saver = new TextSaver(ML, new TextSaver.Arguments {
                    Silent = true, OutputHeader = false
                });
                IDataView savedData = TakeFilter.Create(ML, est.Fit(data).Transform(data), 4);
                using (var fs = File.Create(outputPath))
                    DataSaverUtils.SaveDataView(ch, saver, savedData, fs, keepHidden: true);
            }
            CheckEquality("FeatureContribution", testFile + ".tsv", digitsOfPrecision: precision);
            Done();
        }
Exemple #9
0
 private static TrainerInfo MakeTrainerInfo(ITrainerEstimator <IPredictorTransformer <TScalarPredictor>, TScalarPredictor> estimator)
 => new TrainerInfo(estimator.TrainerInfo.NeedNormalization, estimator.TrainerInfo.NeedCalibration, false);
Exemple #10
0
 public MyOva(IHostEnvironment env, ITrainerEstimator <IPredictorTransformer <TScalarPredictor>, TScalarPredictor> estimator,
              string featureColumn = DefaultColumnNames.Features, string labelColumn = DefaultColumnNames.Label)
     : base(env, MakeTrainerInfo(estimator), featureColumn, labelColumn)
 {
     _binaryEstimator = estimator;
 }
Exemple #11
0
        protected override EstimatorChain <RegressionPredictionTransformer <LinearRegressionModelParameters> > GetPipeLine(ITrainerEstimator <RegressionPredictionTransformer <LinearRegressionModelParameters>, LinearRegressionModelParameters> linearTrainer)
        {
            return(mLContext.Transforms.CopyColumns("Label", "Count").Append(mLContext.Transforms.Concatenate("Features",
                                                                                                              "Season",
                                                                                                              "Year",
                                                                                                              "Month",
                                                                                                              "Hour",
                                                                                                              "Weekday",
                                                                                                              "Weather",
                                                                                                              "Temperature",
                                                                                                              "NormalizedTemperature",
                                                                                                              "Humidity",
                                                                                                              "Windspeed")).Append(
                       mLContext.Transforms.NormalizeLpNorm("Features"))
                   .Append(linearTrainer));


            //var pipeline = new LearningPipeline();
            //pipeline.Add(new TextLoader(_trainingDataLocation).CreateFrom<BikeSharingDemandSample>(useHeader: true, separator: ','));
            //pipeline.Add(new ColumnCopier(("Count", "Label")));
            //pipeline.Add(;
            //pipeline.Add(_algorythm);
        }
Exemple #12
0
 protected abstract Microsoft.ML.Data.EstimatorChain <TLastTransformer> GetPipeLine(ITrainerEstimator <RegressionPredictionTransformer <LinearRegressionModelParameters>, LinearRegressionModelParameters> linearTrainer);
Exemple #13
0
        /// <summary>
        /// Features: x1, x2, x3, xRand; y = 10*x1 + 20x2 + 5.5x3 + e, xRand- random, Label y is dependant on xRand.
        /// Test verifies that feature contribution scores are outputted along with a score for predicted data.
        /// </summary>
        private void TestFeatureContribution(
            ITrainerEstimator <ISingleFeaturePredictionTransformer <IPredictor>, IPredictor> trainer,
            List <float[]> expectedValues,
            int precision = 6)
        {
            // Setup synthetic dataset.
            const int numInstances = 1000;
            const int numFeatures  = 4;

            var rand = new Random(10);

            float[]   yArray       = new float[numInstances];
            float[][] xArray       = new float[numFeatures][];
            int[]     xRangeArray  = new[] { 1000, 10000, 5000, 1000 };
            float[]   xWeightArray = new[] {
                10,
                20, // Most important feature with high weight. Should have the highest contribution.
                5.5f,
                0,  // Least important feature. Should have the least contribution.
            };

            for (var instanceIndex = 0; instanceIndex < numInstances; instanceIndex++)
            {
                for (int featureIndex = 0; featureIndex < numFeatures; featureIndex++)
                {
                    if (xArray[featureIndex] == null)
                    {
                        xArray[featureIndex] = new float[numInstances];
                    }
                    xArray[featureIndex][instanceIndex] = rand.Next(xRangeArray[featureIndex]);
                    yArray[instanceIndex] += xArray[featureIndex][instanceIndex] * xWeightArray[featureIndex];
                }

                var noise = rand.Next(50);
                yArray[instanceIndex] += noise;
            }

            // Create data view.
            var bldr = new ArrayDataViewBuilder(Env);

            bldr.AddColumn("X1", NumberType.Float, xArray[0]);
            bldr.AddColumn("X2Important", NumberType.Float, xArray[1]);
            bldr.AddColumn("X3", NumberType.Float, xArray[2]);
            bldr.AddColumn("X4Rand", NumberType.Float, xArray[3]);
            bldr.AddColumn("Label", NumberType.Float, yArray);
            var srcDV = bldr.GetDataView();

            var pipeline = ML.Transforms.Concatenate("Features", "X1", "X2Important", "X3", "X4Rand")
                           .AppendCacheCheckpoint(ML)
                           .Append(ML.Transforms.Normalize("Features"));
            var data  = pipeline.Fit(srcDV).Transform(srcDV);
            var model = trainer.Fit(data);
            var args  = new FeatureContributionCalculationTransform.Arguments()
            {
                Bottom = 10,
                Top    = 10
            };
            var output = FeatureContributionCalculationTransform.Create(Env, args, data, model.Model, model.FeatureColumn);

            var transformedOutput = output.AsEnumerable <ScoreAndContribution>(Env, true);
            int rowIndex          = 0;

            foreach (var row in transformedOutput.Take(expectedValues.Count))
            {
                var expectedValue = expectedValues[rowIndex++];
                for (int i = 0; i < numFeatures; i++)
                {
                    Assert.Equal(expectedValue[i], row.FeatureContributions[i], precision);
                }
            }

            Done();
        }
        //mLContext.Regression.Trainers.OnlineGradientDescent(



        protected override EstimatorChain <RegressionPredictionTransformer <LinearRegressionModelParameters> > GetPipeLine(ITrainerEstimator <RegressionPredictionTransformer <LinearRegressionModelParameters>, LinearRegressionModelParameters> linearTrainer)
        => mLContext.Transforms.ReplaceMissingValues("Age", "Age", MissingValueReplacingEstimator.ReplacementMode.Mean)
        .Append(mLContext.Transforms.ReplaceMissingValues("Ws", "Ws", MissingValueReplacingEstimator.ReplacementMode.Mean))
        .Append(mLContext.Transforms.ReplaceMissingValues("Bmp", "Bmp", MissingValueReplacingEstimator.ReplacementMode.Mean))
        .Append(mLContext.Transforms.ReplaceMissingValues("NBA_DraftNumber", "NBA_DraftNumber", MissingValueReplacingEstimator.ReplacementMode.Mean))
        .Append(mLContext.Transforms.NormalizeBinning("NBA_DraftNumber", "NBA_DraftNumber"))
        .Append(mLContext.Transforms.NormalizeMinMax("Age", "Age"))
        .Append(mLContext.Transforms.NormalizeMeanVariance("Ws", "Ws"))
        .Append(mLContext.Transforms.NormalizeMeanVariance("Bmp", "Bmp"))
        .Append(mLContext.Transforms.Concatenate(
                    "Features",
                    new[] { "NBA_DraftNumber", "Age", "Ws", "Bmp" }))
        // .Append(mLContext.Regression.Trainers.FastTree()); // PlatformNotSupportedException
        // .Append(mLContext.Regression.Trainers.OnlineGradientDescent(new OnlineGradientDescentTrainer.Options { })); // InvalidOperationException if you don't normalize.
        // .Append(mLContext.Regression.Trainers.StochasticDualCoordinateAscent());
        .Append(linearTrainer);
Exemple #15
0
 private EstimatorChain <ISingleFeaturePredictionTransformer <T> > CreatePipeline <T>(ITrainerEstimator <ISingleFeaturePredictionTransformer <T>, T> trainer)
     where T : class
 {
     return(CreatePipeline().Append(trainer));
 }
Exemple #16
0
        private void TransformData()
        {
            // Select type of trainer
            ITrainerEstimator <ISingleFeaturePredictionTransformer <IPredictorProducing <float> >, IPredictorProducing <float> > trainer = null;

            Console.WriteLine("-------------------");
            switch (aiEnum)
            {
            case AIEnum.fastTree:
                Console.WriteLine("fastTree");
                trainer = mlContext.BinaryClassification.Trainers.FastTree();
                break;

            case AIEnum.generalizedAdditiveModels:
                Console.WriteLine("generalizedAdditiveModels");
                trainer = mlContext.BinaryClassification.Trainers.GeneralizedAdditiveModels();
                break;

            case AIEnum.logisticRegression:
                Console.WriteLine("logisticRegression");
                trainer = mlContext.BinaryClassification.Trainers.LogisticRegression();
                break;

            case AIEnum.stochasticDualCoordinateAscent:
                Console.WriteLine("stochasticDualCoordinateAscent");
                trainer = mlContext.BinaryClassification.Trainers.StochasticDualCoordinateAscent();
                break;

            case AIEnum.stochasticGradientDescent:
                Console.WriteLine("stochasticGradientDescent");
                trainer = mlContext.BinaryClassification.Trainers.StochasticGradientDescent();
                break;
            }
            Console.WriteLine("-------------------");

            // Create a pipeline
            pipeline = mlContext.Transforms.Categorical.OneHotEncoding(outputColumnName: "IsRegularOneHot", inputColumnName: "IsRegular")
                       .Append(mlContext.Transforms.Categorical.OneHotEncoding(outputColumnName: "IsCyclicOneHot", inputColumnName: "IsCyclic"))
                       .Append(mlContext.Transforms.Categorical.OneHotEncoding(outputColumnName: "IsChordalOneHot", inputColumnName: "IsChordal"))
                       .Append(mlContext.Transforms.Normalize(
                                   new NormalizingEstimator.MinMaxColumn(inputColumnName: "ID_GraphClass", outputColumnName: "ID_GraphClassNormalized", fixZero: true),
                                   new NormalizingEstimator.MinMaxColumn(inputColumnName: "ID_EulerianGraph", outputColumnName: "ID_EulerianGraphNormalized", fixZero: true),
                                   new NormalizingEstimator.MinMaxColumn(inputColumnName: "IsRegularOneHot", outputColumnName: "IsRegularOneHotNormalized", fixZero: true),
                                   new NormalizingEstimator.MinMaxColumn(inputColumnName: "IsCyclicOneHot", outputColumnName: "IsCyclicOneHotNormalized", fixZero: true),
                                   new NormalizingEstimator.MinMaxColumn(inputColumnName: "IsChordalOneHot", outputColumnName: "IsChordalOneHotNormalized", fixZero: true),
                                   new NormalizingEstimator.MinMaxColumn(inputColumnName: "CountVertices", outputColumnName: "CountVerticesNormalized", fixZero: true),
                                   new NormalizingEstimator.MinMaxColumn(inputColumnName: "CountEdges", outputColumnName: "CountEdgesNormalized", fixZero: true),
                                   new NormalizingEstimator.MinMaxColumn(inputColumnName: "CountCutVertices", outputColumnName: "CountCutVerticesNormalized", fixZero: true),
                                   new NormalizingEstimator.MinMaxColumn(inputColumnName: "CountBridges", outputColumnName: "CountBridgesNormalized", fixZero: true),
                                   new NormalizingEstimator.MinMaxColumn(inputColumnName: "Girth", outputColumnName: "GirthNormalized", fixZero: true),
                                   new NormalizingEstimator.MinMaxColumn(inputColumnName: "Dense", outputColumnName: "DenseNormalized", fixZero: true),
                                   new NormalizingEstimator.MinMaxColumn(inputColumnName: "MinimumVertexDegree", outputColumnName: "MinimumVertexDegreeNormalized", fixZero: true),
                                   new NormalizingEstimator.MinMaxColumn(inputColumnName: "MaximumVertexDegree", outputColumnName: "MaximumVertexDegreeNormalized", fixZero: true),
                                   new NormalizingEstimator.MinMaxColumn(inputColumnName: "AverageVertexDegree", outputColumnName: "AverageVertexDegreeNormalized", fixZero: true),
                                   new NormalizingEstimator.MinMaxColumn(inputColumnName: "MedianVertexDegree", outputColumnName: "MedianVertexDegreeNormalized", fixZero: true)))
                       .Append(mlContext.Transforms.Concatenate(DefaultColumnNames.Features, "ID_GraphClassNormalized", "ID_EulerianGraphNormalized", "IsRegularOneHotNormalized", "IsCyclicOneHotNormalized", "IsChordalOneHotNormalized",
                                                                "CountVerticesNormalized", "CountEdgesNormalized", "CountCutVerticesNormalized", /*"CountBridgesNormalized",*/ "GirthNormalized", "DenseNormalized", "MinimumVertexDegreeNormalized", "MaximumVertexDegreeNormalized", "AverageVertexDegreeNormalized"//, /*"MedianVertexDegreeNormalized",*/
                                                                ))
                       .Append(trainer);
        }
Exemple #17
0
 public async Task <Microsoft.ML.Data.TransformerChain <TLastTransformer> > Train(IDataView dataView, ITrainerEstimator <RegressionPredictionTransformer <LinearRegressionModelParameters>, LinearRegressionModelParameters> linearTrainer) =>
 await System.Threading.Tasks.Task.Run(() => GetPipeLine(linearTrainer).Fit(dataView));