コード例 #1
0
        /// <summary>
        /// Runs a train-test experiment on the current pipeline, through entrypoints.
        /// </summary>
        public void RunTrainTestExperiment(IDataView trainData, IDataView testData,
                                           AutoInference.SupportedMetric metric, MacroUtils.TrainerKinds trainerKind, out double testMetricValue,
                                           out double trainMetricValue)
        {
            var experiment = CreateTrainTestExperiment(trainData, testData, trainerKind, true, out var trainTestOutput);

            experiment.Run();

            var dataOut         = experiment.GetOutput(trainTestOutput.OverallMetrics);
            var dataOutTraining = experiment.GetOutput(trainTestOutput.TrainingOverallMetrics);

            testMetricValue  = AutoMlUtils.ExtractValueFromIDV(_env, dataOut, metric.Name);
            trainMetricValue = AutoMlUtils.ExtractValueFromIDV(_env, dataOutTraining, metric.Name);
        }
コード例 #2
0
        /// <summary>
        /// Runs a train-test experiment on the current pipeline, through entrypoints.
        /// </summary>
        public double RunTrainTestExperiment(IDataView trainData, IDataView testData, AutoInference.SupportedMetric metric, MacroUtils.TrainerKinds trainerKind)
        {
            var experiment = CreateTrainTestExperiment(trainData, testData, trainerKind, out var trainTestOutput);

            experiment.Run();
            var dataOut = experiment.GetOutput(trainTestOutput.OverallMetrics);
            var schema  = dataOut.Schema;

            schema.TryGetColumnIndex(metric.Name, out var metricCol);

            using (var cursor = dataOut.GetRowCursor(col => col == metricCol))
            {
                var    getter      = cursor.GetGetter <double>(metricCol);
                double metricValue = 0;
                cursor.MoveNext();
                getter(ref metricValue);
                return(metricValue);
            }
        }