dotnet / dotnet/machinelearning

AutoML 2.0: Trying to serializing params from TrialResult fails

Open
#6,652 0 comments 0 reactions 1 assignee Claimed by @LittleLittleCloud View on GitHub
area-AutoML enhancement needs-further-triage untriaged
Dominant language
C#
Stars
9.4k
Forks
2k
Avg merge
2d 20h
Merged PRs (30d)
11

Description

**System Information (please complete the following information):**
- OS & Version: Windows 11
- ML.NET Version: latest from [main]
- .NET Version: .NET 7.0

**Describe the bug**
At end of AutoML experiment I want to log the parameters used.
This fails:
```
var json = JsonConvert.SerializeObject(result.TrialSettings.Parameter);
System.IO.File.WriteAllText(saveTo + ".param", json);
```

I can still get them with help of .ToString() method and that will be enough for me.
Serializing just would be a easier way.

Any possible code updates should probably also address #6651

(this line also fails due to null from paramData[data]?.Keys == null, just a possible hint:
foreach (var paramKey in result.TrialSettings.Parameter.Keys)
{
if (paramData.Keys.Count() < 50)
{
foreach (var data in paramData.Keys)
{
if (paramData[data] != null && (paramData[data]?.Keys == null || paramData[data].Keys.Count() < 50))

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.