Skip to content

Commit

Permalink
add average_output & objective fields to JSON format (#1850)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitryikh authored and StrikerRUS committed Nov 23, 2018
1 parent d21a0e3 commit 9ef85fd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/boosting/gbdt_model_text.cpp
Expand Up @@ -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 << "\"label_index\":" << label_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\":[\""
<< Common::Join(feature_names_, "\",\"") << "\"],"
Expand Down

0 comments on commit 9ef85fd

Please sign in to comment.