Fix the treatment of LightGbm Evaluation Metric parameters in ML.NET … #3815
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
…and make them conform to LightGbm
Fixes #3761 plus some related issues discovered during investigation
There was a bug in LightGbm
EvaluateMetricType
where if a user specifiedEvaluateMetricType.Default
, the metric would not get added to the options Dictionary, andLightGbmWrappedTraining
would throw because of that.Secondly,
EvaluateMetricType.Default
in LightGbm is supposed to be an empty string "" and LightGbm chooses the default metric according to the problem type when this is specified. This was not present in ML.NET parameter name mappings.EvaluateMetricType.None
is supposed to be "None" in LightGbm but was "" in ML.NET parameter name mappings.[Update: REVERTED] Third, in ML.NET, the default
EvaluationMetric
is set toEvaluateMetricType.Error
for multiclass,EvaluationMetricType.LogLoss
for binary, and so on. This leads to inconsistent behavior from the user's perspective: If a user specifiedEvaluationMetric = EvaluateMetricType.Default
, the parameter passed to LightGbm would be the empty string "" but if they do not specifyEvaluationMetric
at all, the parameter passed to LightGbm would be Error for multiclass, LogLoss for binary, and so on.This PR does the following:
EvaluationMetric
in ML.NET toEvaluationMetricType.Default