Exemple #1
0
        public static CommonOutputs.BinaryClassificationOutput TrainBinary(IHostEnvironment env, LightGbmBinaryTrainer.Options input)
        {
            Contracts.CheckValue(env, nameof(env));
            var host = env.Register("TrainLightGBM");

            host.CheckValue(input, nameof(input));
            EntryPointUtils.CheckInputArgs(host, input);

            return(TrainerEntryPointsUtils.Train <LightGbmBinaryTrainer.Options, CommonOutputs.BinaryClassificationOutput>(host, input,
                                                                                                                           () => new LightGbmBinaryTrainer(host, input),
                                                                                                                           getLabel: () => TrainerEntryPointsUtils.FindColumn(host, input.TrainingData.Schema, input.LabelColumnName),
                                                                                                                           getWeight: () => TrainerEntryPointsUtils.FindColumn(host, input.TrainingData.Schema, input.ExampleWeightColumnName)));
        }
        internal static CommonOutputs.RegressionOutput TrainRegression(IHostEnvironment env, Options options)
        {
            Contracts.CheckValue(env, nameof(env));
            var host = env.Register("TrainOLS");

            host.CheckValue(options, nameof(options));
            EntryPointUtils.CheckInputArgs(host, options);

            return(TrainerEntryPointsUtils.Train <Options, CommonOutputs.RegressionOutput>(host, options,
                                                                                           () => new OlsTrainer(host, options),
                                                                                           () => TrainerEntryPointsUtils.FindColumn(host, options.TrainingData.Schema, options.LabelColumnName),
                                                                                           () => TrainerEntryPointsUtils.FindColumn(host, options.TrainingData.Schema, options.ExampleWeightColumnName)));
        }
Exemple #3
0
        internal static CommonOutputs.BinaryClassificationOutput TrainBinary(IHostEnvironment env, Options input)
        {
            Contracts.CheckValue(env, nameof(env));
            var host = env.Register("TrainAP");

            host.CheckValue(input, nameof(input));
            EntryPointUtils.CheckInputArgs(host, input);

            return(TrainerEntryPointsUtils.Train <Options, CommonOutputs.BinaryClassificationOutput>(host, input,
                                                                                                     () => new AveragedPerceptronTrainer(host, input),
                                                                                                     () => TrainerEntryPointsUtils.FindColumn(host, input.TrainingData.Schema, input.LabelColumnName),
                                                                                                     calibrator: input.Calibrator, maxCalibrationExamples: input.MaxCalibrationExamples));
        }
        public static CommonOutputs.RegressionOutput TrainRegression(IHostEnvironment env, SdcaRegressionTrainer.Options input)
        {
            Contracts.CheckValue(env, nameof(env));
            var host = env.Register("TrainSDCA");

            host.CheckValue(input, nameof(input));
            EntryPointUtils.CheckInputArgs(host, input);

            return(TrainerEntryPointsUtils.Train <SdcaRegressionTrainer.Options, CommonOutputs.RegressionOutput>(host, input,
                                                                                                                 () => new SdcaRegressionTrainer(host, input),
                                                                                                                 () => TrainerEntryPointsUtils.FindColumn(host, input.TrainingData.Schema, input.LabelColumnName)));
        }
        internal static CommonOutputs.BinaryClassificationOutput TrainSymSgd(IHostEnvironment env, Options options)
        {
            Contracts.CheckValue(env, nameof(env));
            var host = env.Register("TrainSymSGD");

            host.CheckValue(options, nameof(options));
            EntryPointUtils.CheckInputArgs(host, options);

            return(TrainerEntryPointsUtils.Train <Options, CommonOutputs.BinaryClassificationOutput>(host, options,
                                                                                                     () => new SymbolicSgdTrainer(host, options),
                                                                                                     () => TrainerEntryPointsUtils.FindColumn(host, options.TrainingData.Schema, options.LabelColumnName)));
        }
Exemple #6
0
        internal static CommonOutputs.BinaryClassificationOutput TrainBinary(IHostEnvironment env, Options input)
        {
            Contracts.CheckValue(env, nameof(env));
            var host = env.Register("Train a field-aware factorization machine");

            host.CheckValue(input, nameof(input));
            EntryPointUtils.CheckInputArgs(host, input);
            return(TrainerEntryPointsUtils.Train <Options, CommonOutputs.BinaryClassificationOutput>(host, input, () => new FieldAwareFactorizationMachineTrainer(host, input),
                                                                                                     () => TrainerEntryPointsUtils.FindColumn(host, input.TrainingData.Schema, input.LabelColumnName)));
        }
        internal static CommonOutputs.MulticlassClassificationOutput TrainMultiClassNaiveBayesTrainer(IHostEnvironment env, Options input)
        {
            Contracts.CheckValue(env, nameof(env));
            var host = env.Register("TrainMultiClassNaiveBayes");

            host.CheckValue(input, nameof(input));
            EntryPointUtils.CheckInputArgs(host, input);

            return(TrainerEntryPointsUtils.Train <Options, CommonOutputs.MulticlassClassificationOutput>(host, input,
                                                                                                         () => new MultiClassNaiveBayesTrainer(host, input),
                                                                                                         () => TrainerEntryPointsUtils.FindColumn(host, input.TrainingData.Schema, input.LabelColumnName)));
        }
Exemple #8
0
        public static CommonOutputs.RegressionOutput CreateRegressionEnsemble(IHostEnvironment env, RegressionEnsembleTrainer.Arguments input)
        {
            Contracts.CheckValue(env, nameof(env));
            var host = env.Register("TrainRegressionEnsemble");

            host.CheckValue(input, nameof(input));
            EntryPointUtils.CheckInputArgs(host, input);

            return(TrainerEntryPointsUtils.Train <RegressionEnsembleTrainer.Arguments, CommonOutputs.RegressionOutput>(host, input,
                                                                                                                       () => new RegressionEnsembleTrainer(host, input),
                                                                                                                       () => TrainerEntryPointsUtils.FindColumn(host, input.TrainingData.Schema, input.LabelColumnName)));
        }
Exemple #9
0
        public static CommonOutputs.BinaryClassificationOutput TrainBinary(IHostEnvironment env, FastForestBinaryTrainer.Options input)
        {
            Contracts.CheckValue(env, nameof(env));
            var host = env.Register("TrainFastForest");

            host.CheckValue(input, nameof(input));
            EntryPointUtils.CheckInputArgs(host, input);

            return(TrainerEntryPointsUtils.Train <FastForestBinaryTrainer.Options, CommonOutputs.BinaryClassificationOutput>(host, input,
                                                                                                                             () => new FastForestBinaryTrainer(host, input),
                                                                                                                             () => TrainerEntryPointsUtils.FindColumn(host, input.TrainingData.Schema, input.LabelColumnName),
                                                                                                                             () => TrainerEntryPointsUtils.FindColumn(host, input.TrainingData.Schema, input.ExampleWeightColumnName),
                                                                                                                             () => TrainerEntryPointsUtils.FindColumn(host, input.TrainingData.Schema, input.RowGroupColumnName),
                                                                                                                             calibrator: input.Calibrator, maxCalibrationExamples: input.MaxCalibrationExamples));
        }