MCPcopy Create free account
hub / github.com/antmachineintelligence/mtgbmcode / Predict

Method Predict

src/boosting/gbdt_prediction.cpp:59–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

57}
58
59void 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
71void GBDT::PredictByMap(const std::unordered_map<int, double>& features, double* output, const PredictionEarlyStopInstance* early_stop) const {
72 PredictRawByMap(features, output, early_stop);

Callers 1

PredictRawMethod · 0.45

Calls 1

ConvertOutputMethod · 0.45

Tested by

no test coverage detected