"...git@developer.sourcefind.cn:tianlh/lightgbm-dcu.git" did not exist on "d90a16d520fa12d84ecd983fba323727348616a4"
Unverified Commit c45ec4f1 authored by Guolin Ke's avatar Guolin Ke Committed by GitHub
Browse files

dump_model() bug with num_leaves=1

parent 24ad35f7
......@@ -506,6 +506,12 @@ Tree::Tree(const char* str, size_t* used_len) {
} else {
Log::Fatal("Tree model string format error, should contain leaf_value field");
}
if (key_vals.count("shrinkage")) {
Common::Atof(key_vals["shrinkage"].c_str(), &shrinkage_);
} else {
shrinkage_ = 1.0f;
}
if (num_leaves_ <= 1) { return; }
......@@ -576,12 +582,6 @@ Tree::Tree(const char* str, size_t* used_len) {
Log::Fatal("Tree model should contain cat_threshold field");
}
}
if (key_vals.count("shrinkage")) {
Common::Atof(key_vals["shrinkage"].c_str(), &shrinkage_);
} else {
shrinkage_ = 1.0f;
}
max_depth_ = -1;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment