Skip to content

Return average metrics in AutoML CrossValSummaryRunner #5042

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

Closed
najeeb-kazmi opened this issue Apr 20, 2020 · 0 comments · Fixed by #5031
Closed

Return average metrics in AutoML CrossValSummaryRunner #5042

najeeb-kazmi opened this issue Apr 20, 2020 · 0 comments · Fixed by #5031
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

@najeeb-kazmi
Copy link
Member

Related to #4663
See also #5031 (comment)

CrossValSummaryRunner in AutoML gets invoked when the dataset size is less than 15k rows. It runs 10-fold cross validation and computes the average optimization metric across the folds. It then reports all the metrics from the fold that has the optimization metric closest to this average.

var avgScore = trainResults.Average(r => r.score);
var indexClosestToAvg = GetIndexClosestToAverage(trainResults.Select(r => r.score), avgScore);
var metricsClosestToAvg = trainResults[indexClosestToAvg].metrics;

A better way to do this would be to calculate the average of all the metrics, instantiate a new metrics class with these averages, and return that in the run details. This could reuse the code for calculating the average of non_NaN metrics from #5031. The following two things will need to be figured out and need more discussion:

  1. PerClassLogLoss: For multiclass classification, the ordering of the class labels may be different across the 10 folds. So, the PerClassLogLoss metric from each fold will have different indices for the class labels. In this situation, a standardized ordering would need to be figured out and the averages calculated for each class accordingly.

  2. ConfusionMatrix: For multiclass classification, the same problem as above needs solving. In addition, for both binary and multiclass classification, what confusion matrix is returned needs discussion. The distribution of class labels will be different across the folds, so what exactly is the "average" of a confusion matrix? Do we return a confusion matrix at all? Do we just return the confusion matrix from the fold with optimization metric closest to the average (current behavior)? If we are going this route, the confusion matrix property in the metrics classes will need to be made internally settable, as there is no constructor that takes the confusion matrix as an argument.

@najeeb-kazmi najeeb-kazmi added AutoML.NET Automating various steps of the machine learning process P1 Priority of the issue for triage purpose: Needs to be fixed soon. P2 Priority of the issue for triage purpose: Needs to be fixed at some point. and removed P1 Priority of the issue for triage purpose: Needs to be fixed soon. labels Apr 20, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Mar 18, 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.

1 participant