From 29d92edbf157159890f408570f3ad3c0a82f9308 Mon Sep 17 00:00:00 2001 From: daholste <43974253+daholste@users.noreply.github.com> Date: Wed, 24 Apr 2019 18:58:01 -0700 Subject: [PATCH] [AutoML] Add AutoML example code (#3458) --- Microsoft.ML.AutoML.sln | 14 ++++ .../BinaryClassificationExperiment.cs | 74 ++++++++++++++++++ .../DataStructures/PixelData.cs | 14 ++++ .../DataStructures/PixelPrediction.cs | 10 +++ .../DataStructures/SentimentIssue.cs | 13 ++++ .../DataStructures/SentimentPrediction.cs | 14 ++++ .../DataStructures/TaxiTrip.cs | 28 +++++++ .../DataStructures/TaxiTripFarePrediction.cs | 10 +++ .../Microsoft.ML.AutoML.Samples.csproj | 12 +++ .../MulticlassClassificationExperiment.cs | 71 +++++++++++++++++ .../Microsoft.ML.AutoML.Samples/Program.cs | 30 ++++++++ .../RegressionExperiment.cs | 76 +++++++++++++++++++ src/Microsoft.ML.Auto/API/AutoCatalog.cs | 24 ++++-- .../API/BinaryClassificationExperiment.cs | 6 ++ .../API/MulticlassClassificationExperiment.cs | 6 ++ .../API/RegressionExperiment.cs | 6 ++ 16 files changed, 402 insertions(+), 6 deletions(-) create mode 100644 docs/samples/Microsoft.ML.AutoML.Samples/BinaryClassificationExperiment.cs create mode 100644 docs/samples/Microsoft.ML.AutoML.Samples/DataStructures/PixelData.cs create mode 100644 docs/samples/Microsoft.ML.AutoML.Samples/DataStructures/PixelPrediction.cs create mode 100644 docs/samples/Microsoft.ML.AutoML.Samples/DataStructures/SentimentIssue.cs create mode 100644 docs/samples/Microsoft.ML.AutoML.Samples/DataStructures/SentimentPrediction.cs create mode 100644 docs/samples/Microsoft.ML.AutoML.Samples/DataStructures/TaxiTrip.cs create mode 100644 docs/samples/Microsoft.ML.AutoML.Samples/DataStructures/TaxiTripFarePrediction.cs create mode 100644 docs/samples/Microsoft.ML.AutoML.Samples/Microsoft.ML.AutoML.Samples.csproj create mode 100644 docs/samples/Microsoft.ML.AutoML.Samples/MulticlassClassificationExperiment.cs create mode 100644 docs/samples/Microsoft.ML.AutoML.Samples/Program.cs create mode 100644 docs/samples/Microsoft.ML.AutoML.Samples/RegressionExperiment.cs diff --git a/Microsoft.ML.AutoML.sln b/Microsoft.ML.AutoML.sln index 0fa15ef556..9cd9a7900d 100644 --- a/Microsoft.ML.AutoML.sln +++ b/Microsoft.ML.AutoML.sln @@ -10,6 +10,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "mlnet", "src\mlnet\mlnet.cs EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "mlnet.Tests", "test\mlnet.Tests\mlnet.Tests.csproj", "{AAC3E4E6-C146-44BB-8873-A1E61D563F2A}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.AutoML.Samples", "docs\samples\Microsoft.ML.AutoML.Samples\Microsoft.ML.AutoML.Samples.csproj", "{6E84E7C5-FECE-45A9-AD4C-4B0F39F78904}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -68,6 +70,18 @@ Global {AAC3E4E6-C146-44BB-8873-A1E61D563F2A}.Release-Intrinsics|Any CPU.Build.0 = Release-Intrinsics|Any CPU {AAC3E4E6-C146-44BB-8873-A1E61D563F2A}.Release-netfx|Any CPU.ActiveCfg = Release-netfx|Any CPU {AAC3E4E6-C146-44BB-8873-A1E61D563F2A}.Release-netfx|Any CPU.Build.0 = Release-netfx|Any CPU + {6E84E7C5-FECE-45A9-AD4C-4B0F39F78904}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6E84E7C5-FECE-45A9-AD4C-4B0F39F78904}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6E84E7C5-FECE-45A9-AD4C-4B0F39F78904}.Debug-Intrinsics|Any CPU.ActiveCfg = Debug-Intrinsics|Any CPU + {6E84E7C5-FECE-45A9-AD4C-4B0F39F78904}.Debug-Intrinsics|Any CPU.Build.0 = Debug-Intrinsics|Any CPU + {6E84E7C5-FECE-45A9-AD4C-4B0F39F78904}.Debug-netfx|Any CPU.ActiveCfg = Debug-netfx|Any CPU + {6E84E7C5-FECE-45A9-AD4C-4B0F39F78904}.Debug-netfx|Any CPU.Build.0 = Debug-netfx|Any CPU + {6E84E7C5-FECE-45A9-AD4C-4B0F39F78904}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6E84E7C5-FECE-45A9-AD4C-4B0F39F78904}.Release|Any CPU.Build.0 = Release|Any CPU + {6E84E7C5-FECE-45A9-AD4C-4B0F39F78904}.Release-Intrinsics|Any CPU.ActiveCfg = Release-Intrinsics|Any CPU + {6E84E7C5-FECE-45A9-AD4C-4B0F39F78904}.Release-Intrinsics|Any CPU.Build.0 = Release-Intrinsics|Any CPU + {6E84E7C5-FECE-45A9-AD4C-4B0F39F78904}.Release-netfx|Any CPU.ActiveCfg = Release-netfx|Any CPU + {6E84E7C5-FECE-45A9-AD4C-4B0F39F78904}.Release-netfx|Any CPU.Build.0 = Release-netfx|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/docs/samples/Microsoft.ML.AutoML.Samples/BinaryClassificationExperiment.cs b/docs/samples/Microsoft.ML.AutoML.Samples/BinaryClassificationExperiment.cs new file mode 100644 index 0000000000..f419ac8a34 --- /dev/null +++ b/docs/samples/Microsoft.ML.AutoML.Samples/BinaryClassificationExperiment.cs @@ -0,0 +1,74 @@ +using System; +using System.IO; +using System.Linq; +using Microsoft.ML.Auto; +using Microsoft.ML.Data; + +namespace Microsoft.ML.AutoML.Samples +{ + public static class BinaryClassificationExperiment + { + private static string TrainDataPath = ""; + private static string TestDataPath = ""; + private static string ModelPath = @"\SentimentModel.zip"; + private static uint ExperimentTime = 60; + + public static void Run() + { + MLContext mlContext = new MLContext(); + + // STEP 1: Load data + IDataView trainDataView = mlContext.Data.LoadFromTextFile(TrainDataPath, hasHeader: true); + IDataView testDataView = mlContext.Data.LoadFromTextFile(TestDataPath, hasHeader: true); + + // STEP 2: Run AutoML experiment + Console.WriteLine($"Running AutoML binary classification experiment for {ExperimentTime} seconds..."); + ExperimentResult experimentResult = mlContext.Auto() + .CreateBinaryClassificationExperiment(ExperimentTime) + .Execute(trainDataView); + + // STEP 3: Print metric from the best model + RunDetail bestRun = experimentResult.BestRun; + Console.WriteLine($"Total models produced: {experimentResult.RunDetails.Count()}"); + Console.WriteLine($"Best model's trainer: {bestRun.TrainerName}"); + Console.WriteLine($"Metrics of best model from validation data --"); + PrintMetrics(bestRun.ValidationMetrics); + + // STEP 4: Evaluate test data + IDataView testDataViewWithBestScore = bestRun.Model.Transform(testDataView); + BinaryClassificationMetrics testMetrics = mlContext.BinaryClassification.EvaluateNonCalibrated(testDataViewWithBestScore); + Console.WriteLine($"Metrics of best model on test data --"); + PrintMetrics(testMetrics); + + // STEP 5: Save the best model for later deployment and inferencing + using (FileStream fs = File.Create(ModelPath)) + mlContext.Model.Save(bestRun.Model, trainDataView.Schema, fs); + + // STEP 6: Create prediction engine from the best trained model + var predictionEngine = mlContext.Model.CreatePredictionEngine(bestRun.Model); + + // STEP 7: Initialize a new sentiment issue, and get the predicted sentiment + var testSentimentIssue = new SentimentIssue + { + Text = "I hope this helps." + }; + var prediction = predictionEngine.Predict(testSentimentIssue); + Console.WriteLine($"Predicted sentiment for test issue: {prediction.Prediction}"); + + Console.WriteLine("Press any key to continue..."); + Console.ReadKey(); + } + + private static void PrintMetrics(BinaryClassificationMetrics metrics) + { + Console.WriteLine($"Accuracy: {metrics.Accuracy}"); + Console.WriteLine($"AreaUnderPrecisionRecallCurve: {metrics.AreaUnderPrecisionRecallCurve}"); + Console.WriteLine($"AreaUnderRocCurve: {metrics.AreaUnderRocCurve}"); + Console.WriteLine($"F1Score: {metrics.F1Score}"); + Console.WriteLine($"NegativePrecision: {metrics.NegativePrecision}"); + Console.WriteLine($"NegativeRecall: {metrics.NegativeRecall}"); + Console.WriteLine($"PositivePrecision: {metrics.PositivePrecision}"); + Console.WriteLine($"PositiveRecall: {metrics.PositiveRecall}"); + } + } +} diff --git a/docs/samples/Microsoft.ML.AutoML.Samples/DataStructures/PixelData.cs b/docs/samples/Microsoft.ML.AutoML.Samples/DataStructures/PixelData.cs new file mode 100644 index 0000000000..8c745f97d0 --- /dev/null +++ b/docs/samples/Microsoft.ML.AutoML.Samples/DataStructures/PixelData.cs @@ -0,0 +1,14 @@ +using Microsoft.ML.Data; + +namespace Microsoft.ML.AutoML.Samples +{ + public class PixelData + { + [LoadColumn(0, 63)] + [VectorType(64)] + public float[] PixelValues; + + [LoadColumn(64)] + public float Number; + } +} diff --git a/docs/samples/Microsoft.ML.AutoML.Samples/DataStructures/PixelPrediction.cs b/docs/samples/Microsoft.ML.AutoML.Samples/DataStructures/PixelPrediction.cs new file mode 100644 index 0000000000..0cd8878ec1 --- /dev/null +++ b/docs/samples/Microsoft.ML.AutoML.Samples/DataStructures/PixelPrediction.cs @@ -0,0 +1,10 @@ +using Microsoft.ML.Data; + +namespace Microsoft.ML.AutoML.Samples +{ + public class PixelPrediction + { + [ColumnName("PredictedLabel")] + public float Prediction; + } +} diff --git a/docs/samples/Microsoft.ML.AutoML.Samples/DataStructures/SentimentIssue.cs b/docs/samples/Microsoft.ML.AutoML.Samples/DataStructures/SentimentIssue.cs new file mode 100644 index 0000000000..1480c5da5d --- /dev/null +++ b/docs/samples/Microsoft.ML.AutoML.Samples/DataStructures/SentimentIssue.cs @@ -0,0 +1,13 @@ +using Microsoft.ML.Data; + +namespace Microsoft.ML.AutoML.Samples +{ + public class SentimentIssue + { + [LoadColumn(0)] + public bool Label { get; set; } + + [LoadColumn(1)] + public string Text { get; set; } + } +} diff --git a/docs/samples/Microsoft.ML.AutoML.Samples/DataStructures/SentimentPrediction.cs b/docs/samples/Microsoft.ML.AutoML.Samples/DataStructures/SentimentPrediction.cs new file mode 100644 index 0000000000..ac77d77c4e --- /dev/null +++ b/docs/samples/Microsoft.ML.AutoML.Samples/DataStructures/SentimentPrediction.cs @@ -0,0 +1,14 @@ +using Microsoft.ML.Data; + +namespace Microsoft.ML.AutoML.Samples +{ + public class SentimentPrediction + { + // ColumnName attribute is used to change the column name from + // its default value, which is the name of the field. + [ColumnName("PredictedLabel")] + public bool Prediction { get; set; } + + public float Score { get; set; } + } +} diff --git a/docs/samples/Microsoft.ML.AutoML.Samples/DataStructures/TaxiTrip.cs b/docs/samples/Microsoft.ML.AutoML.Samples/DataStructures/TaxiTrip.cs new file mode 100644 index 0000000000..9a7ed798d8 --- /dev/null +++ b/docs/samples/Microsoft.ML.AutoML.Samples/DataStructures/TaxiTrip.cs @@ -0,0 +1,28 @@ +using Microsoft.ML.Data; + +namespace Microsoft.ML.AutoML.Samples +{ + public class TaxiTrip + { + [LoadColumn(0)] + public string VendorId; + + [LoadColumn(1)] + public float RateCode; + + [LoadColumn(2)] + public float PassengerCount; + + [LoadColumn(3)] + public float TripTimeInSeconds; + + [LoadColumn(4)] + public float TripDistance; + + [LoadColumn(5)] + public string PaymentType; + + [LoadColumn(6)] + public float FareAmount; + } +} diff --git a/docs/samples/Microsoft.ML.AutoML.Samples/DataStructures/TaxiTripFarePrediction.cs b/docs/samples/Microsoft.ML.AutoML.Samples/DataStructures/TaxiTripFarePrediction.cs new file mode 100644 index 0000000000..fde03d24b2 --- /dev/null +++ b/docs/samples/Microsoft.ML.AutoML.Samples/DataStructures/TaxiTripFarePrediction.cs @@ -0,0 +1,10 @@ +using Microsoft.ML.Data; + +namespace Microsoft.ML.AutoML.Samples +{ + public class TaxiTripFarePrediction + { + [ColumnName("Score")] + public float FareAmount; + } +} diff --git a/docs/samples/Microsoft.ML.AutoML.Samples/Microsoft.ML.AutoML.Samples.csproj b/docs/samples/Microsoft.ML.AutoML.Samples/Microsoft.ML.AutoML.Samples.csproj new file mode 100644 index 0000000000..2df6f91704 --- /dev/null +++ b/docs/samples/Microsoft.ML.AutoML.Samples/Microsoft.ML.AutoML.Samples.csproj @@ -0,0 +1,12 @@ + + + + Exe + netcoreapp2.1 + + + + + + + diff --git a/docs/samples/Microsoft.ML.AutoML.Samples/MulticlassClassificationExperiment.cs b/docs/samples/Microsoft.ML.AutoML.Samples/MulticlassClassificationExperiment.cs new file mode 100644 index 0000000000..b422982ac7 --- /dev/null +++ b/docs/samples/Microsoft.ML.AutoML.Samples/MulticlassClassificationExperiment.cs @@ -0,0 +1,71 @@ +using System; +using System.IO; +using System.Linq; +using Microsoft.ML.Auto; +using Microsoft.ML.Data; + +namespace Microsoft.ML.AutoML.Samples +{ + public static class MulticlassClassificationExperiment + { + private static string TrainDataPath = ""; + private static string TestDataPath = ""; + private static string ModelPath = @"\OptDigitsModel.zip"; + private static string LabelColumnName = "Number"; + private static uint ExperimentTime = 60; + + public static void Run() + { + MLContext mlContext = new MLContext(); + + // STEP 1: Load data + IDataView trainDataView = mlContext.Data.LoadFromTextFile(TrainDataPath, separatorChar: ','); + IDataView testDataView = mlContext.Data.LoadFromTextFile(TestDataPath, separatorChar: ','); + + // STEP 2: Run AutoML experiment + Console.WriteLine($"Running AutoML multiclass classification experiment for {ExperimentTime} seconds..."); + ExperimentResult experimentResult = mlContext.Auto() + .CreateMulticlassClassificationExperiment(ExperimentTime) + .Execute(trainDataView, LabelColumnName); + + // STEP 3: Print metric from the best model + RunDetail bestRun = experimentResult.BestRun; + Console.WriteLine($"Total models produced: {experimentResult.RunDetails.Count()}"); + Console.WriteLine($"Best model's trainer: {bestRun.TrainerName}"); + Console.WriteLine($"Metrics of best model from validation data --"); + PrintMetrics(bestRun.ValidationMetrics); + + // STEP 4: Evaluate test data + IDataView testDataViewWithBestScore = bestRun.Model.Transform(testDataView); + MulticlassClassificationMetrics testMetrics = mlContext.MulticlassClassification.Evaluate(testDataViewWithBestScore, labelColumnName: LabelColumnName); + Console.WriteLine($"Metrics of best model on test data --"); + PrintMetrics(testMetrics); + + // STEP 5: Save the best model for later deployment and inferencing + using (FileStream fs = File.Create(ModelPath)) + mlContext.Model.Save(bestRun.Model, trainDataView.Schema, fs); + + // STEP 6: Create prediction engine from the best trained model + var predictionEngine = mlContext.Model.CreatePredictionEngine(bestRun.Model); + + // STEP 7: Initialize new pixel data, and get the predicted number + var testPixelData = new PixelData + { + PixelValues = new float[] { 0, 0, 1, 8, 15, 10, 0, 0, 0, 3, 13, 15, 14, 14, 0, 0, 0, 5, 10, 0, 10, 12, 0, 0, 0, 0, 3, 5, 15, 10, 2, 0, 0, 0, 16, 16, 16, 16, 12, 0, 0, 1, 8, 12, 14, 8, 3, 0, 0, 0, 0, 10, 13, 0, 0, 0, 0, 0, 0, 11, 9, 0, 0, 0 } + }; + var prediction = predictionEngine.Predict(testPixelData); + Console.WriteLine($"Predicted number for test pixels: {prediction.Prediction}"); + + Console.WriteLine("Press any key to continue..."); + Console.ReadKey(); + } + + private static void PrintMetrics(MulticlassClassificationMetrics metrics) + { + Console.WriteLine($"LogLoss: {metrics.LogLoss}"); + Console.WriteLine($"LogLossReduction: {metrics.LogLossReduction}"); + Console.WriteLine($"MacroAccuracy: {metrics.MacroAccuracy}"); + Console.WriteLine($"MicroAccuracy: {metrics.MicroAccuracy}"); + } + } +} diff --git a/docs/samples/Microsoft.ML.AutoML.Samples/Program.cs b/docs/samples/Microsoft.ML.AutoML.Samples/Program.cs new file mode 100644 index 0000000000..115764bd4f --- /dev/null +++ b/docs/samples/Microsoft.ML.AutoML.Samples/Program.cs @@ -0,0 +1,30 @@ +using System; + +namespace Microsoft.ML.AutoML.Samples +{ + public class Program + { + public static void Main(string[] args) + { + try + { + RegressionExperiment.Run(); + Console.Clear(); + + BinaryClassificationExperiment.Run(); + Console.Clear(); + + MulticlassClassificationExperiment.Run(); + Console.Clear(); + + Console.WriteLine("Done"); + } + catch (Exception ex) + { + Console.WriteLine($"Exception {ex}"); + } + + Console.ReadLine(); + } + } +} diff --git a/docs/samples/Microsoft.ML.AutoML.Samples/RegressionExperiment.cs b/docs/samples/Microsoft.ML.AutoML.Samples/RegressionExperiment.cs new file mode 100644 index 0000000000..54f8b56461 --- /dev/null +++ b/docs/samples/Microsoft.ML.AutoML.Samples/RegressionExperiment.cs @@ -0,0 +1,76 @@ +using System; +using System.IO; +using System.Linq; +using Microsoft.ML.Auto; +using Microsoft.ML.Data; + +namespace Microsoft.ML.AutoML.Samples +{ + public static class RegressionExperiment + { + private static string TrainDataPath = ""; + private static string TestDataPath = ""; + private static string ModelPath = @"\TaxiFareModel.zip"; + private static string LabelColumnName = "FareAmount"; + private static uint ExperimentTime = 60; + + public static void Run() + { + MLContext mlContext = new MLContext(); + + // STEP 1: Load data + IDataView trainDataView = mlContext.Data.LoadFromTextFile(TrainDataPath, hasHeader: true, separatorChar: ','); + IDataView testDataView = mlContext.Data.LoadFromTextFile(TestDataPath, hasHeader: true, separatorChar: ','); + + // STEP 2: Run AutoML experiment + Console.WriteLine($"Running AutoML regression experiment for {ExperimentTime} seconds..."); + ExperimentResult experimentResult = mlContext.Auto() + .CreateRegressionExperiment(ExperimentTime) + .Execute(trainDataView, LabelColumnName); + + // STEP 3: Print metric from best model + RunDetail bestRun = experimentResult.BestRun; + Console.WriteLine($"Total models produced: {experimentResult.RunDetails.Count()}"); + Console.WriteLine($"Best model's trainer: {bestRun.TrainerName}"); + Console.WriteLine($"Metrics of best model from validation data --"); + PrintMetrics(bestRun.ValidationMetrics); + + // STEP 5: Evaluate test data + IDataView testDataViewWithBestScore = bestRun.Model.Transform(testDataView); + RegressionMetrics testMetrics = mlContext.Regression.Evaluate(testDataViewWithBestScore, labelColumnName: LabelColumnName); + Console.WriteLine($"Metrics of best model on test data --"); + PrintMetrics(testMetrics); + + // STEP 6: Save the best model for later deployment and inferencing + using (FileStream fs = File.Create(ModelPath)) + mlContext.Model.Save(bestRun.Model, trainDataView.Schema, fs); + + // STEP 7: Create prediction engine from the best trained model + var predictionEngine = mlContext.Model.CreatePredictionEngine(bestRun.Model); + + // STEP 8: Initialize a new test taxi trip, and get the predicted fare + var testTaxiTrip = new TaxiTrip + { + VendorId = "VTS", + RateCode = 1, + PassengerCount = 1, + TripTimeInSeconds = 1140, + TripDistance = 3.75f, + PaymentType = "CRD" + }; + var prediction = predictionEngine.Predict(testTaxiTrip); + Console.WriteLine($"Predicted fare for test taxi trip: {prediction.FareAmount}"); + + Console.WriteLine("Press any key to continue..."); + Console.ReadKey(); + } + + private static void PrintMetrics(RegressionMetrics metrics) + { + Console.WriteLine($"MeanAbsoluteError: {metrics.MeanAbsoluteError}"); + Console.WriteLine($"MeanSquaredError: {metrics.MeanSquaredError}"); + Console.WriteLine($"RootMeanSquaredError: {metrics.RootMeanSquaredError}"); + Console.WriteLine($"RSquared: {metrics.RSquared}"); + } + } +} diff --git a/src/Microsoft.ML.Auto/API/AutoCatalog.cs b/src/Microsoft.ML.Auto/API/AutoCatalog.cs index 37966c3992..0344892b44 100644 --- a/src/Microsoft.ML.Auto/API/AutoCatalog.cs +++ b/src/Microsoft.ML.Auto/API/AutoCatalog.cs @@ -24,12 +24,13 @@ internal AutoCatalog(MLContext context) /// Maximum number of seconds that experiment will run. /// A new AutoML regression experiment. /// - /// An experiment may run for longer than . + /// See for a more detailed code example of an AutoML regression experiment. + /// An experiment may run for longer than . /// This is because once AutoML starts training an ML.NET model, AutoML lets the /// model train to completion. For instance, if the first model /// AutoML trains takes 4 hours, and the second model trained takes 5 hours, /// but was the number of seconds in 6 hours, - /// the experiment will run for 4 + 5 = 9 hours (not 6 hours). + /// the experiment will run for 4 + 5 = 9 hours (not 6 hours). /// public RegressionExperiment CreateRegressionExperiment(uint maxExperimentTimeInSeconds) { @@ -44,6 +45,9 @@ public RegressionExperiment CreateRegressionExperiment(uint maxExperimentTimeInS /// /// Settings for the AutoML experiment. /// A new AutoML regression experiment. + /// + /// See for a more detailed code example of an AutoML regression experiment. + /// public RegressionExperiment CreateRegressionExperiment(RegressionExperimentSettings experimentSettings) { return new RegressionExperiment(_context, experimentSettings); @@ -55,12 +59,13 @@ public RegressionExperiment CreateRegressionExperiment(RegressionExperimentSetti /// Maximum number of seconds that experiment will run. /// A new AutoML binary classification experiment. /// - /// An experiment may run for longer than . + /// See for a more detailed code example of an AutoML binary classification experiment. + /// An experiment may run for longer than . /// This is because once AutoML starts training an ML.NET model, AutoML lets the /// model train to completion. For instance, if the first model /// AutoML trains takes 4 hours, and the second model trained takes 5 hours, /// but was the number of seconds in 6 hours, - /// the experiment will run for 4 + 5 = 9 hours (not 6 hours). + /// the experiment will run for 4 + 5 = 9 hours (not 6 hours). /// public BinaryClassificationExperiment CreateBinaryClassificationExperiment(uint maxExperimentTimeInSeconds) { @@ -75,6 +80,9 @@ public BinaryClassificationExperiment CreateBinaryClassificationExperiment(uint /// /// Settings for the AutoML experiment. /// A new AutoML binary classification experiment. + /// + /// See for a more detailed code example of an AutoML binary classification experiment. + /// public BinaryClassificationExperiment CreateBinaryClassificationExperiment(BinaryExperimentSettings experimentSettings) { return new BinaryClassificationExperiment(_context, experimentSettings); @@ -86,12 +94,13 @@ public BinaryClassificationExperiment CreateBinaryClassificationExperiment(Binar /// Maximum number of seconds that experiment will run. /// A new AutoML multiclass classification experiment. /// - /// An experiment may run for longer than . + /// See for a more detailed code example of an AutoML multiclass classification experiment. + /// An experiment may run for longer than . /// This is because once AutoML starts training an ML.NET model, AutoML lets the /// model train to completion. For instance, if the first model /// AutoML trains takes 4 hours, and the second model trained takes 5 hours, /// but was the number of seconds in 6 hours, - /// the experiment will run for 4 + 5 = 9 hours (not 6 hours). + /// the experiment will run for 4 + 5 = 9 hours (not 6 hours). /// public MulticlassClassificationExperiment CreateMulticlassClassificationExperiment(uint maxExperimentTimeInSeconds) { @@ -106,6 +115,9 @@ public MulticlassClassificationExperiment CreateMulticlassClassificationExperime /// /// Settings for the AutoML experiment. /// A new AutoML multiclass classification experiment. + /// + /// See for a more detailed code example of an AutoML multiclass classification experiment. + /// public MulticlassClassificationExperiment CreateMulticlassClassificationExperiment(MulticlassExperimentSettings experimentSettings) { return new MulticlassClassificationExperiment(_context, experimentSettings); diff --git a/src/Microsoft.ML.Auto/API/BinaryClassificationExperiment.cs b/src/Microsoft.ML.Auto/API/BinaryClassificationExperiment.cs index c3de696345..2c07652026 100644 --- a/src/Microsoft.ML.Auto/API/BinaryClassificationExperiment.cs +++ b/src/Microsoft.ML.Auto/API/BinaryClassificationExperiment.cs @@ -132,6 +132,12 @@ public enum BinaryClassificationTrainer /// /// AutoML experiment on binary classification datasets. /// + /// + /// + /// + /// public sealed class BinaryClassificationExperiment : ExperimentBase { internal BinaryClassificationExperiment(MLContext context, BinaryExperimentSettings settings) diff --git a/src/Microsoft.ML.Auto/API/MulticlassClassificationExperiment.cs b/src/Microsoft.ML.Auto/API/MulticlassClassificationExperiment.cs index ea254a2c66..183ed489e7 100644 --- a/src/Microsoft.ML.Auto/API/MulticlassClassificationExperiment.cs +++ b/src/Microsoft.ML.Auto/API/MulticlassClassificationExperiment.cs @@ -122,6 +122,12 @@ public enum MulticlassClassificationTrainer /// /// AutoML experiment on multiclass classification datasets. /// + /// + /// + /// + /// public sealed class MulticlassClassificationExperiment : ExperimentBase { internal MulticlassClassificationExperiment(MLContext context, MulticlassExperimentSettings settings) diff --git a/src/Microsoft.ML.Auto/API/RegressionExperiment.cs b/src/Microsoft.ML.Auto/API/RegressionExperiment.cs index 58f2973511..45e50a61d5 100644 --- a/src/Microsoft.ML.Auto/API/RegressionExperiment.cs +++ b/src/Microsoft.ML.Auto/API/RegressionExperiment.cs @@ -108,6 +108,12 @@ public enum RegressionTrainer /// /// AutoML experiment on regression classification datasets. /// + /// + /// + /// + /// public sealed class RegressionExperiment : ExperimentBase { internal RegressionExperiment(MLContext context, RegressionExperimentSettings settings)