-
-
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
Define multi-strategy parameter. #8890
Conversation
@@ -779,9 +810,17 @@ class LearnerConfiguration : public Learner { | |||
if (obj_ == nullptr || tparam_.objective != old.objective) { | |||
obj_.reset(ObjFunction::Create(tparam_.objective, &ctx_)); | |||
} | |||
|
|||
bool has_nc {cfg_.find("num_class") != cfg_.cend()}; |
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.
This change is made to fix the removed lines above. The change limits the inserted parameter into this function instead of propagating it through the entire library.
@@ -12,10 +12,11 @@ | |||
#include <vector> | |||
|
|||
#include "xgboost/c_api.h" | |||
#include "xgboost/data.h" // DMatrix | |||
#include "xgboost/data.h" // DMatrix | |||
#include "xgboost/feature_map.h" // for FeatureMap |
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.
The feature map
is no longer included in learner.h
. This is to fix missing includes.
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.
Here's my suggestion for naming.
include/xgboost/learner.h
Outdated
|
||
void Copy(LearnerModelParam const& that); | ||
[[nodiscard]] bool IsVectorLeaf() const noexcept { return multi_strategy == Strategy::kMono; } |
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.
Reminder to myself: Treelite should soon add ability to handle vector leaf outputs from XGBoost models
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.
It will take some time to mature. The current implementation is less than alpha.
Extracted from #8616 .
The naming is
compo
for composite andmono
for monolithic. It's probably not the best name, please make your suggestions. ;-)Sorry for polluting the change with include-what-you-use comments. I can remove them if it makes review difficult.
I plan to slowly integrate it into the xgboost code base to have a clear view of what we are using and to eliminate unneeded includes to reduce compile time. If reviewers prefer having a dedicated PR for header changes, please let me know in the comments. ;-)