dotnet / machinelearning

ML.NET is an open source and cross-platform machine learning framework for .NET.
https://dot.net/ml
MIT License
8.99k stars 1.88k forks source link

AutoML 2.0: setting temporary folder model #6687

Open torronen opened 1 year ago

torronen commented 1 year ago

How to set the path where temporary models could be stored in AutoML 2.0?

When working with big datasets, users may want to save all models generated during experiment for later analysis. For example, trying again with extended test sets, running sensitivity analysis, feature importance etc.

=> It would be useful to be able to save the path of temporary models to a known location. Even better if one could set the prefix for the temporary models (for example "mydata-Model1.zip" where "mydata" is the prefix)

torronen commented 1 year ago

In principle, this could be one option, but I am not sure if this is the correct .Save method because it requires MLContext as a parameter, and I also do not know if IMonitor somehow has access to MLContext.

        public class AutoMLMonitor : IMonitor
        {
         public void ReportBestTrial(TrialResult result)
            {
               //where to get ctx from, and how to get data.Schema? result.Model has only outputschema, but I believe this is input schema.
                ctx.Model.Save(model, data.Schema, saveTo);

                // where to get context from?
                result.Model.Save(ctx)
michaelgsharp commented 7 months ago

@LittleLittleCloud