public void OVAWithAllConstructorArgs()
        {
            var(pipeline, data) = GetMultiClassPipeline();
            var calibrator        = new PlattCalibratorTrainer(Env);
            var averagePerceptron = new AveragedPerceptronTrainer(Env, new AveragedPerceptronTrainer.Arguments {
                FeatureColumn = "Features", LabelColumn = "Label", Shuffle = true, Calibrator = null
            });

            pipeline.Append(new Ova(Env, averagePerceptron, "Label", true, calibrator: calibrator, 10000, true))
            .Append(new KeyToValueEstimator(Env, "PredictedLabel"));

            TestEstimatorCore(pipeline, data);
            Done();
        }
示例#2
0
        public void OVAWithAllConstructorArgs()
        {
            var(pipeline, data) = GetMultiClassPipeline();
            var calibrator        = new PlattCalibratorTrainer(Env);
            var averagePerceptron = ML.BinaryClassification.Trainers.AveragedPerceptron(
                new AveragedPerceptronTrainer.Options {
                Shuffle = true, Calibrator = null
            });

            pipeline = pipeline.Append(new Ova(Env, averagePerceptron, "Label", true, calibrator: calibrator, 10000, true))
                       .Append(new KeyToValueMappingEstimator(Env, "PredictedLabel"));

            TestEstimatorCore(pipeline, data);
            Done();
        }
示例#3
0
        public void OVAWithAllConstructorArgs()
        {
            var(pipeline, data) = GetMultiClassPipeline();
            var calibrator        = new PlattCalibratorTrainer(Env);
            var averagePerceptron = new AveragedPerceptronTrainer(Env, "Label", "Features", advancedSettings: s =>
            {
                s.Shuffle    = true;
                s.Calibrator = null;
            });

            pipeline.Append(new Ova(Env, averagePerceptron, "Label", true, calibrator: calibrator, 10000, true))
            .Append(new KeyToValueMappingEstimator(Env, "PredictedLabel"));

            TestEstimatorCore(pipeline, data);
            Done();
        }
示例#4
0
        public void OVAWithAllConstructorArgs()
        {
            var(pipeline, data) = GetMultiClassPipeline();
            var calibrator        = new PlattCalibratorTrainer(Env);
            var averagePerceptron = ML.BinaryClassification.Trainers.AveragedPerceptron(
                new AveragedPerceptronTrainer.Options {
                Shuffle = true, Calibrator = null
            });

            var ova = ML.MulticlassClassification.Trainers.OneVersusAll(averagePerceptron, imputeMissingLabelsAsNegative: true,
                                                                        calibrator: calibrator, maxCalibrationExamples: 10000, useProbabilities: true);

            pipeline = pipeline.Append(ova)
                       .Append(new KeyToValueMappingEstimator(Env, "PredictedLabel"));

            TestEstimatorCore(pipeline, data);
            Done();
        }