Skip to content

Commit

Permalink
fix #1142 (feature name with = symbol).
Browse files Browse the repository at this point in the history
  • Loading branch information
guolinke committed Dec 25, 2017
1 parent 87d4ce0 commit 72f2349
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/boosting/gbdt_model_text.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,11 @@ bool GBDT::LoadModelFromString(const char* buffer, size_t len) {
key_vals[strs[0]] = strs[1];
}
else if (strs.size() > 2) {
Log::Fatal("Wrong line at model file: %s", cur_line.c_str());
if (strs[0] == "feature_name") {
key_vals[strs[0]] = cur_line.substr(std::strlen("feature_names=")).c_str();
} else {
Log::Fatal("Wrong line at model file: %s", cur_line.substr(0, 128).c_str());
}
}
}
else {
Expand Down

0 comments on commit 72f2349

Please sign in to comment.