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

Method PredictByMap

src/boosting/gbdt_prediction.cpp:71–81  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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);
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
83void GBDT::PredictLeafIndex(const double* features, double* output) const {
84 int total_tree = num_iteration_for_pred_ * num_tree_per_iteration_;

Callers 2

PredictRawByMapMethod · 0.45
PredictorMethod · 0.45

Calls 1

ConvertOutputMethod · 0.45

Tested by

no test coverage detected