Prevent training without setting up caches. (#4066)
* Prevent training without setting up caches. * Add warning for internal functions. * Check number of features. * Address reviewer's comment.
This commit is contained in:
committed by
Philip Hyunsu Cho
parent
7a652a8c64
commit
1088dff42c
@@ -703,6 +703,8 @@ class LearnerImpl : public Learner {
|
||||
if (num_feature > mparam_.num_feature) {
|
||||
mparam_.num_feature = num_feature;
|
||||
}
|
||||
CHECK_NE(mparam_.num_feature, 0)
|
||||
<< "0 feature is supplied. Are you using raw Booster?";
|
||||
// setup
|
||||
cfg_["num_feature"] = common::ToString(mparam_.num_feature);
|
||||
CHECK(obj_ == nullptr && gbm_ == nullptr);
|
||||
|
||||
Reference in New Issue
Block a user