Skip to content

Commit 6911cf5

Browse files
committed
Formatted C++ logic
1 parent 755e6f0 commit 6911cf5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

include/stochtree/tree_sampler.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,9 @@ static inline void EvaluateCutpoints(Tree* tree, ForestTracker& tracker, LeafMod
601601
double feature_weight;
602602
for (data_size_t i = 0; i < valid_cutpoint_count; i++) {
603603
// Determine whether the feature is categorical (and thus needs to be re-weighted)
604-
if ((cutpoint_feature_types[i] == FeatureType::kOrderedCategorical) || (cutpoint_feature_types[i] == FeatureType::kUnorderedCategorical)) {
604+
if ((cutpoint_feature_types[i] == FeatureType::kOrderedCategorical) ||
605+
(cutpoint_feature_types[i] == FeatureType::kUnorderedCategorical)) {
606+
// Weight according to max continuous feature cutpoint count / categorical feature cutpoint count
605607
feature_weight = ((double) max_feature_cutpoint_count) / ((double) feature_cutpoint_counts[cutpoint_features[i]]);
606608
log_cutpoint_evaluations[i] += std::log(feature_weight);
607609
}

0 commit comments

Comments
 (0)