-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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
[Blocking] Fix #3840: Clean up logic for parsing tree_method parameter #3849
Conversation
Compiler will give warnings if switch statements don't handle all possible values of C++11 enum class. Also allow enum class to be used as DMLC parameter.
@Laurae2 This should fix the issue with selecting correct |
3165c9b
to
ba924a4
Compare
Codecov Report
@@ Coverage Diff @@
## master #3849 +/- ##
============================================
+ Coverage 51.85% 52.13% +0.27%
Complexity 203 203
============================================
Files 181 183 +2
Lines 14360 14453 +93
Branches 495 495
============================================
+ Hits 7447 7535 +88
- Misses 6675 6680 +5
Partials 238 238
Continue to review full report at Codecov.
|
@hcho3 Hi, I'm a little bit confused by the configuration logic, does linear models require configuration? Another thing, updaters for linear model are |
@trivialfis Yes it was my oversight. The warning shouldn't have been displayed for gblinear. |
…meter (dmlc#3849) * Clean up logic for converting tree_method to updater sequence * Use C++11 enum class for extra safety Compiler will give warnings if switch statements don't handle all possible values of C++11 enum class. Also allow enum class to be used as DMLC parameter. * Fix compiler error + lint * Address reviewer comment * Better docstring for DECLARE_FIELD_ENUM_CLASS * Fix lint * Add C++ test to see if tree_method is recognized * Fix clang-tidy error * Add test_learner.h to R package * Update comments * Fix lint error
Try to consolidate logic concerning
tree_method
andupdater
into one place. Also use C++11 enum class fortree_method
for extra safety. (For instance, compilers will generate warning if aswitch
statement doesn't handle all possible values of an enum class. This makes our code future-proof, in case someone decides to add another tree method.)Closes #3840.