dotnet / dotnet/machinelearning-samples
AutoML - how to read values of L1Regularization and L2Regularization and selected algorithm name?
- Dominant language
- PowerShell
- Stars
- 4.7k
- Forks
- 2.7k
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 1
Description
Hi
When I use VS designer to generate model it generates for example file MyModel.training.cs with such code which can be used to re-train model using the same paramters.
```
public static IEstimator BuildPipeline(MLContext mlContext)
{
// Data process configuration with pipeline data transformations
var pipeline = mlContext.Transforms.Text.FeaturizeText(inputColumnName:@"col0",outputColumnName:@"col0")
.Append(mlContext.Transforms.Concatenate(@"Features", new []{@"col0"}))
.Append(mlContext.Transforms.Conversion.MapValueToKey(outputColumnName:@"col1",inputColumnName:@"col1",addKeyValueAnnotationsAsText:false))
.Append(mlContext.MulticlassClassification.Trainers.LightGbm(new LightGbmMulticlassTrainer.Options(){NumberOfLeaves=2717,NumberOfIterations=2632,MinimumExampleCountPerLeaf=29,LearningRate=0.0609179057439351,LabelColumnName=@"col1",FeatureColumnName=@"Features",ExampleWeightColumnName=null,Booster=new GradientBooster.Options(){SubsampleFraction=0.999999776672986,FeatureFraction=0.99999999,L1Regularization=1.67496587225263E-09,L2Regularization=0.999999776672986},MaximumBinCountPerFeature=207}))
.Append(mlContext.Transforms.Conversion.MapKeyToValue(outputColumnName:@"PredictedLabel",inputColumnName:@"PredictedLabel"));
return pipeline;
}
```
If I use AutoML `TrialResult experimentResults = await experiment.RunAsync();` I cannot find there name of the algorithm and its params which have been used to generate this mode.
I found this doc https://learn.microsoft.com/en-us/dotnet/machine-learning/how-to-guides/train-machine-learning-model-ml-net#extract-model-parameters but in my case any casting ends with null value.
I was trying these casts but every time I see the null value
```
model as TransformerChain>
model as TransformerChain>
model as TransformerChain>
```
Contributor guide
Assessment
This issue has not been assessed yet.