in Configure, set random seed only for uninitialized model

This commit is contained in:
Vadim Khotilovich 2016-04-26 02:03:22 -05:00
parent 0527b17c9d
commit 3e0732dea9

View File

@ -189,10 +189,10 @@ class LearnerImpl : public Learner {
mparam.InitAllowUnknown(args);
name_obj_ = cfg_["objective"];
name_gbm_ = cfg_["booster"];
// set seed only before the model is initialized
common::GlobalRandom().seed(tparam.seed);
}
common::GlobalRandom().seed(tparam.seed);
// set number of features correctly.
cfg_["num_feature"] = common::ToString(mparam.num_feature);
cfg_["num_class"] = common::ToString(mparam.num_class);