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

Method InitPredict

src/boosting/gbdt.h:341–352  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

339 inline int NumberOfClasses() const override { return num_class_; }
340
341 inline void InitPredict(int num_iteration, bool is_pred_contrib) override {
342 num_iteration_for_pred_ = static_cast<int>(models_.size()) / num_tree_per_iteration_;
343 if (num_iteration > 0) {
344 num_iteration_for_pred_ = std::min(num_iteration, num_iteration_for_pred_);
345 }
346 if (is_pred_contrib) {
347 #pragma omp parallel for schedule(static)
348 for (int i = 0; i < static_cast<int>(models_.size()); ++i) {
349 models_[i]->RecomputeMaxDepth();
350 }
351 }
352 }
353
354 inline double GetLeafValue(int tree_idx, int leaf_idx) const override {
355 CHECK(tree_idx >= 0 && static_cast<size_t>(tree_idx) < models_.size());

Callers

nothing calls this directly

Calls 2

sizeMethod · 0.45
RecomputeMaxDepthMethod · 0.45

Tested by

no test coverage detected