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

Method CategoricalDecision

include/LightGBM/tree.h:260–278  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

258 }
259
260 inline int CategoricalDecision(double fval, int node) const {
261 uint8_t missing_type = GetMissingType(decision_type_[node]);
262 int int_fval = static_cast<int>(fval);
263 if (int_fval < 0) {
264 return right_child_[node];;
265 } else if (std::isnan(fval)) {
266 // NaN is always in the right
267 if (missing_type == 2) {
268 return right_child_[node];
269 }
270 int_fval = 0;
271 }
272 int cat_idx = static_cast<int>(threshold_[node]);
273 if (Common::FindInBitset(cat_threshold_.data() + cat_boundaries_[cat_idx],
274 cat_boundaries_[cat_idx + 1] - cat_boundaries_[cat_idx], int_fval)) {
275 return left_child_[node];
276 }
277 return right_child_[node];
278 }
279
280 inline int CategoricalDecisionInner(uint32_t fval, int node) const {
281 int cat_idx = static_cast<int>(threshold_in_bin_[node]);

Callers

nothing calls this directly

Calls 2

dataMethod · 0.80
FindInBitsetFunction · 0.50

Tested by

no test coverage detected