public void OVAWithExplicitCalibrator()
        {
            var(pipeline, data) = GetMultiClassPipeline();
            var calibrator = new PavCalibratorTrainer(Env);

            var sdcaTrainer = new LinearClassificationTrainer(Env, new LinearClassificationTrainer.Arguments {
                MaxIterations = 100, Shuffle = true, NumThreads = 1
            }, "Features", "Label");

            pipeline.Append(new Ova(Env, sdcaTrainer, "Label", calibrator: calibrator, maxCalibrationExamples: 990000))
            .Append(new KeyToValueEstimator(Env, "PredictedLabel"));

            TestEstimatorCore(pipeline, data);
            Done();
        }
示例#2
0
        public void OVAWithExplicitCalibrator()
        {
            var dataPath = GetDataPath(IrisDataPath);

            using (var env = new TlcEnvironment())
            {
                var calibrator = new PavCalibratorTrainer(env);

                var data = new TextLoader(env, GetIrisLoaderArgs()).Read(new MultiFileSource(dataPath));

                var sdcaTrainer = new LinearClassificationTrainer(env, new LinearClassificationTrainer.Arguments {
                    MaxIterations = 100, Shuffle = true, NumThreads = 1
                }, "Features", "Label");
                var pipeline = new TermEstimator(env, "Label")
                               .Append(new Ova(env, sdcaTrainer, "Label", calibrator: calibrator, maxCalibrationExamples: 990000))
                               .Append(new KeyToValueEstimator(env, "PredictedLabel"));

                TestEstimatorCore(pipeline, data);
            }
        }