| 57 | } |
| 58 | |
| 59 | void GBDT::Predict(const double* features, double* output, const PredictionEarlyStopInstance* early_stop) const { |
| 60 | PredictRaw(features, output, early_stop); |
| 61 | if (average_output_) { |
| 62 | for (int k = 0; k < num_tree_per_iteration_; ++k) { |
| 63 | output[k] /= num_iteration_for_pred_; |
| 64 | } |
| 65 | } |
| 66 | if (objective_function_ != nullptr) { |
| 67 | objective_function_->ConvertOutput(output, output); |
| 68 | } |
| 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); |
no test coverage detected