Skip to content

AutoML 2.0: regression throws The given key 'e4' was not present in the dictionary. #6755

Open
@torronen

Description

@torronen

System Information (please complete the following information):

  • OS & Version: windows 11
  • ML.NET Version: ML.NET nightly 4th July 2023
  • .NET Version: .NET 7.0

Describe the bug

When running regression experiment I got this error. It seems to appear at "random" experiment. I have got it on 2nd, 4th and now not yet for 21 trials.

System.Collections.Generic.KeyNotFoundException: The given key 'e4' was not present in the dictionary.
   at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
   at Microsoft.ML.SearchSpace.SearchSpace.MappingToFeatureSpace(Parameter parameter)
   at Microsoft.ML.SearchSpace.SearchSpace.MappingToFeatureSpace(Parameter parameter)
   at Microsoft.ML.AutoML.CsvTrialResultManager.Save()
   at Microsoft.ML.AutoML.AutoMLExperiment.RunAsync(CancellationToken ct)
   at Kwork.MLTrainer2023Regression.Program.TrainRegression(List`1 trainingDataFiles, String LabelColumn, String saveTo, UInt32 trainingTimeSeconds) in C:\git\Kwork.MLTrainer2023\Kwork.MLTrainer2023Regression\Program.cs:line 422
   at Kwork.MLTrainer2023Regression.Program.Main(String[] args) in C:\git\Kwork.MLTrainer2023\Kwork.MLTrainer2023Regression\Program.cs:line 190
The given key 'e4' was not present in the dictionary.
   at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
   at Microsoft.ML.SearchSpace.SearchSpace.MappingToFeatureSpace(Parameter parameter)
   at Microsoft.ML.SearchSpace.SearchSpace.MappingToFeatureSpace(Parameter parameter)
   at Microsoft.ML.AutoML.CsvTrialResultManager.Save()
   at Microsoft.ML.AutoML.AutoMLExperiment.RunAsync(CancellationToken ct)
   at Kwork.MLTrainer2023Regression.Program.TrainRegression(List`1 trainingDataFiles, String LabelColumn, String saveTo, UInt32 trainingTimeSeconds) in C:\git\Kwork.MLTrainer2023\Kwork.MLTrainer2023Regression\Program.cs:line 422
   at Kwork.MLTrainer2023Regression.Program.Main(String[] args) in C:\git\Kwork.MLTrainer2023\Kwork.MLTrainer2023Regression\

my code:

                pipeline = ctx.Transforms
               .SelectColumns(columnsToKeep) // Keep only the specified columns
               .Append(ctx.Auto().Featurizer(data, columnInformation: columnInference.ColumnInformation))
               .Append(ctx.Auto().Regression(labelColumnName: columnInference.ColumnInformation.LabelColumnName,
                useFastForest: false, useSdca: false, useLbfgsPoissonRegression: false, useLgbm: false,
               useFastTree: true
               )); //disable slow FastForest, run LightGBM on GPU machine
  ```

AutoMLExperiment.AutoMLExperimentSettings settings = new AutoMLExperiment.AutoMLExperimentSettings();
AutoMLExperiment experiment = ctx.Auto().CreateExperiment();

        // Configure experiment
        experiment
            .SetPipeline(pipeline)
            .SetRegressionMetric(RegressionMetric.RootMeanSquaredError, labelColumn: columnInference.ColumnInformation.LabelColumnName)
            .SetTrainingTimeInSeconds(trainingTimeSeconds)
            .SetDataset(data, fold: NumFolds, samplingKeyColumnName: SamplingKeyColumn)
            .SetEciCostFrugalTuner();

        var monitor = new AutoMLMonitor(pipeline);
        experiment.SetMonitor(monitor);

        var cts = new CancellationTokenSource();
        Console.WriteLine("Start experiment");
        TrialResult experimentResults = await experiment.RunAsync(cts.Token);
   
   
   

Metadata

Metadata

Labels

AutoML.NETAutomating various steps of the machine learning process

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions