-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Add deterministic option for LightGBM #7415
Add deterministic option for LightGBM #7415
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a deterministic option along with related options for the LightGBM trainer to ensure reproducible training outcomes. Key changes include:
- Adding new options (Deterministic, ForceRowWise, and ForceColumnWise) in the LightGBM trainer options.
- Updating the options mapping dictionary in the trainer base.
- Updating tests to set the new options for LightGBM estimators.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
File | Description |
---|---|
src/Microsoft.ML.LightGbm/LightGbmTrainerBase.cs | Added dictionary entries and properties for deterministic options. |
test/Microsoft.ML.Tests/TrainerEstimators/TreeEstimators.cs | Updated tests to initialize Deterministic and ForceRowWise options. |
Comments suppressed due to low confidence (2)
src/Microsoft.ML.LightGbm/LightGbmTrainerBase.cs:243
- [nitpick] Consider clarifying the help text for 'Deterministic' to state that it ensures reproducible training outcomes, rather than mentioning 'stable results'.
/// Setting this to true should ensure the stable results when using the same data and the same parameters and different num_threads.
test/Microsoft.ML.Tests/TrainerEstimators/TreeEstimators.cs:69
- Consider adding a test case that explicitly sets and verifies the behavior of the 'ForceColumnWise' option, as it is a new addition not covered in the existing tests.
Deterministic = true,
/// Setting this to true should ensure the stable results when using the same data and the same parameters and different num_threads. | ||
/// </summary> | ||
[Argument(ArgumentType.AtMostOnce, HelpText = "Whether to use deterministic algorithm.")] | ||
public bool Deterministic = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe we use reflection to instantiate these (like when you run this from ML.NET command line), and if its expecting fields it wouldn't work. I will double check on that before I merge this in.
If it is doing that, its possible that we could change things to either do both or only do properites and update all the options as well.
Microsoft.ML.RunTests.TestEntryPoints.EntryPointCatalog is failing on all legs. https://helixr1107v0xdeko0k025g8.blob.core.windows.net/dotnet-machinelearning-refs-pull-7415-merge-504196c4ce1c401a92/Microsoft.ML.Core.Tests/1/console.55b4bee6.log?helixlogtype=result
Looks like you need to update |
@ericstj good catch. Its been updated. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #7415 +/- ##
==========================================
- Coverage 68.97% 68.96% -0.01%
==========================================
Files 1481 1481
Lines 273696 273708 +12
Branches 28285 28285
==========================================
- Hits 188782 188769 -13
- Misses 77526 77546 +20
- Partials 7388 7393 +5
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
/ba-g failed tests are known failures and build analysis still isn't configured correctly to go green. |
Fixes #7326.
Adds the LightGBM deterministic option to the LightGBM Options.