Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto train pipeline Bug #5437

Closed
taha-ghadirian opened this issue Oct 14, 2020 · 1 comment · Fixed by #5445
Closed

Auto train pipeline Bug #5437

taha-ghadirian opened this issue Oct 14, 2020 · 1 comment · Fixed by #5445
Assignees
Labels
AutoML.NET Automating various steps of the machine learning process P2 Priority of the issue for triage purpose: Needs to be fixed at some point.

Comments

@taha-ghadirian
Copy link

taha-ghadirian commented Oct 14, 2020

System information

  • OS version/distro: Windows server 2012r2 - windows 10
  • .NET Version: .net core 3.1
  • Ml.net Version: Last Stable Version.

Issue

  • What did you do?: Set a auto Training pipeline using API, set a long MaxExperimentTimeInSeconds (For example 600) for small dataset.
  • What happened?: Program hanged without any response.
  • What did you expect?: the program should stop training after 600 seconds. and show me the result.
  • Am I Tested it with shorter time?: Yes! I Tested it with 120Seconds and 100 Seconds. Its work currectly!

Source code / logs

var experimentSettings = new MulticlassExperimentSettings()
            {
                MaxExperimentTimeInSeconds = 600,
                CacheDirectory = new DirectoryInfo("cache"),
                CacheBeforeTrainer = CacheBeforeTrainer.Auto,
                OptimizingMetric = MulticlassClassificationMetric.MicroAccuracy,
            };
        var experiment = mlContext.Auto().CreateMulticlassClassificationExperiment(experimentSettings);

        var crossValidationExperimentResult = experiment.Execute(
            trainData: mappedInputData,
            labelColumnName: "Label",
            progressHandler: new Progress<RunDetail<MulticlassClassificationMetrics>>()
        );

toplearn

@justinormont
Copy link
Contributor

How many models were produced? The AutoML code returns between models; consequently a slow model causes the end time to be approximate.

Possible fix: (inside of AutoML)
Have AutoML use ML․NET's ctx.CancelExecution() function to interrupt the current model when the timer expires.

Perhaps something like:

Timer timer = new System.Timers.Timer(_experimentSettings.MaxExperimentTimeInSeconds * 1000);
timer.Elapsed += timerHandler;
timer.AutoReset = false;
timer.Enabled = true;

private void timerHandler(object sender, EventArgs e) {
    ctx.CancelExecution();
}

Placed before AutoML's do/while sweeping loop.

We may want to consider adding a parameter of MinIterations defaulting to 1, so we ensure that at least one model is created. Currently once AutoML starts the first model, the time expiring won't cancel it.

Refs:

@mstfbl mstfbl self-assigned this Oct 19, 2020
@mstfbl mstfbl added AutoML.NET Automating various steps of the machine learning process P2 Priority of the issue for triage purpose: Needs to be fixed at some point. labels Oct 20, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Mar 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
AutoML.NET Automating various steps of the machine learning process P2 Priority of the issue for triage purpose: Needs to be fixed at some point.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants