FastForest(
            this SweepableBinaryClassificationTrainers trainer,
            string labelColumnName   = "Label",
            string featureColumnName = "Features",
            SweepableOption <FastForestBinaryTrainer.Options> optionBuilder = null,
            FastForestBinaryTrainer.Options defaultOption = null)
        {
            var context = trainer.Context;

            if (optionBuilder == null)
            {
                optionBuilder = FastForestBinaryTrainerSweepableOptions.Default;
            }

            optionBuilder.SetDefaultOption(defaultOption);
            return(context.AutoML().CreateSweepableEstimator(
                       (context, option) =>
            {
                option.LabelColumnName = labelColumnName;
                option.FeatureColumnName = featureColumnName;

                return context.BinaryClassification.Trainers.FastForest(option);
            },
                       optionBuilder,
                       new string[] { labelColumnName, featureColumnName },
                       new string[] { PredictedLabel },
                       nameof(FastForestBinaryTrainer)));
        }
Exemplo n.º 2
0
        OnlineGradientDescent(
            this SweepableRegressionTrainers trainers,
            string labelColumnName   = "Label",
            string featureColumnName = "Features",
            SweepableOption <OnlineGradientDescentTrainer.Options> optionSweeper = null,
            OnlineGradientDescentTrainer.Options defaultOption = null)
        {
            var context = trainers.Context;

            if (optionSweeper == null)
            {
                optionSweeper = OnlineGradientDescentTrainerSweepableOptions.Default;
            }

            optionSweeper.SetDefaultOption(defaultOption);

            return(context.AutoML().CreateSweepableEstimator(
                       (context, option) =>
            {
                option.LabelColumnName = labelColumnName;
                option.FeatureColumnName = featureColumnName;

                return context.Regression.Trainers.OnlineGradientDescent(option);
            },
                       optionSweeper,
                       new string[] { labelColumnName, featureColumnName },
                       new string[] { Score },
                       nameof(OnlineGradientDescentTrainer)));
        }
        SdcaNonCalibreated(this SweepableMultiClassificationTrainers trainer, string labelColumnName = "Label", string featureColumnName = "Features", SweepableOption <SdcaNonCalibratedMulticlassTrainer.Options> optionBuilder = null, SdcaNonCalibratedMulticlassTrainer.Options defaultOption = null)
        {
            var context = trainer.Context;

            if (optionBuilder == null)
            {
                optionBuilder = SdcaNonCalibratedMulticlassTrainerSweepableOptions.Default;
            }

            optionBuilder.SetDefaultOption(defaultOption);

            return(context.AutoML().CreateSweepableEstimator(
                       (context, option) =>
            {
                option.LabelColumnName = labelColumnName;
                option.FeatureColumnName = featureColumnName;
                return context.MulticlassClassification.Trainers.SdcaNonCalibrated(option);
            },
                       optionBuilder,
                       trainerName: nameof(SdcaNonCalibratedMulticlassTrainer),
                       inputs: new string[] { featureColumnName },
                       outputs: new string[] { PredictedLabel }));
        }
        LightGbm(this SweepableMultiClassificationTrainers trainer, string labelColumnName = "Label", string featureColumnName = "Features", SweepableOption <LightGbmMulticlassTrainer.Options> optionBuilder = null, LightGbmMulticlassTrainer.Options defaultOption = null)
        {
            var context = trainer.Context;

            if (optionBuilder == null)
            {
                optionBuilder = LightGbmMulticlassTrainerSweepableOptions.Default;
            }

            optionBuilder.SetDefaultOption(defaultOption);

            return(context.AutoML().CreateSweepableEstimator(
                       (context, option) =>
            {
                if (defaultOption != null)
                {
                    Util.CopyFieldsTo(defaultOption, option);
                }

                option.LabelColumnName = labelColumnName;
                option.FeatureColumnName = featureColumnName;
                return context.MulticlassClassification.Trainers.LightGbm(option);
            },
                       optionBuilder,
                       trainerName: nameof(LightGbmMulticlassTrainer),
                       inputs: new string[] { featureColumnName },
                       outputs: new string[] { PredictedLabel }));
        }
Exemplo n.º 5
0
 public static SweepableEstimator <TNewTrain, TOption> CreateSweepableEstimator <TNewTrain, TOption>(Func <TOption, TNewTrain> estimatorFactory, SweepableOption <TOption> optionBuilder, TransformerScope scope = TransformerScope.Everything, string estimatorName = null, string[] inputs = null, string[] outputs = null)
     where TNewTrain : IEstimator <ITransformer>
     where TOption : class
 {
     return(new SweepableEstimator <TNewTrain, TOption>(estimatorFactory, optionBuilder, scope, estimatorName, inputs, outputs));
 }