Commit 9ef85fd8 authored by Dmitry Khominich's avatar Dmitry Khominich Committed by Nikita Titov
Browse files

add average_output & objective fields to JSON format (#1850)

parent d21a0e39
...@@ -22,6 +22,10 @@ std::string GBDT::DumpModel(int start_iteration, int num_iteration) const { ...@@ -22,6 +22,10 @@ std::string GBDT::DumpModel(int start_iteration, int num_iteration) const {
str_buf << "\"num_tree_per_iteration\":" << num_tree_per_iteration_ << "," << '\n'; str_buf << "\"num_tree_per_iteration\":" << num_tree_per_iteration_ << "," << '\n';
str_buf << "\"label_index\":" << label_idx_ << "," << '\n'; str_buf << "\"label_index\":" << label_idx_ << "," << '\n';
str_buf << "\"max_feature_idx\":" << max_feature_idx_ << "," << '\n'; str_buf << "\"max_feature_idx\":" << max_feature_idx_ << "," << '\n';
str_buf << "\"average_output\":" << (average_output_ ? "true" : "false") << ",\n";
if (objective_function_ != nullptr) {
str_buf << "\"objective\":\"" << objective_function_->ToString() << "\",\n";
}
str_buf << "\"feature_names\":[\"" str_buf << "\"feature_names\":[\""
<< Common::Join(feature_names_, "\",\"") << "\"]," << Common::Join(feature_names_, "\",\"") << "\"],"
......
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