| 69 | } |
| 70 | |
| 71 | void GBDT::PredictByMap(const std::unordered_map<int, double>& features, double* output, const PredictionEarlyStopInstance* early_stop) const { |
| 72 | PredictRawByMap(features, output, early_stop); |
| 73 | if (average_output_) { |
| 74 | for (int k = 0; k < num_tree_per_iteration_; ++k) { |
| 75 | output[k] /= num_iteration_for_pred_; |
| 76 | } |
| 77 | } |
| 78 | if (objective_function_ != nullptr) { |
| 79 | objective_function_->ConvertOutput(output, output); |
| 80 | } |
| 81 | } |
| 82 | |
| 83 | void GBDT::PredictLeafIndex(const double* features, double* output) const { |
| 84 | int total_tree = num_iteration_for_pred_ * num_tree_per_iteration_; |
no test coverage detected