Skip to content

Commit

Permalink
add corner boosting option
Browse files Browse the repository at this point in the history
  • Loading branch information
paulbkoch committed Jan 17, 2025
1 parent 811fe13 commit 1d45042
Show file tree
Hide file tree
Showing 11 changed files with 901 additions and 157 deletions.
1 change: 1 addition & 0 deletions R/src/Makevars
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ OBJECTS = \
$(NATIVEDIR)/interpretable_numerics.o \
$(NATIVEDIR)/PartitionOneDimensionalBoosting.o \
$(NATIVEDIR)/PartitionRandomBoosting.o \
$(NATIVEDIR)/PartitionMultiDimensionalCorner.o \
$(NATIVEDIR)/PartitionMultiDimensionalTree.o \
$(NATIVEDIR)/PartitionMultiDimensionalStraight.o \
$(NATIVEDIR)/Purify.o \
Expand Down
1 change: 1 addition & 0 deletions R/src/Makevars.interpret
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ OBJECTS = \
$(NATIVEDIR)/interpretable_numerics.o \
$(NATIVEDIR)/PartitionOneDimensionalBoosting.o \
$(NATIVEDIR)/PartitionRandomBoosting.o \
$(NATIVEDIR)/PartitionMultiDimensionalCorner.o \
$(NATIVEDIR)/PartitionMultiDimensionalTree.o \
$(NATIVEDIR)/PartitionMultiDimensionalStraight.o \
$(NATIVEDIR)/Purify.o \
Expand Down
2 changes: 2 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,7 @@ if [ $is_conda -eq 1 ]; then
${CXX} -c ${CPPFLAGS} ${CXXFLAGS} ${extras} "$code_path/interpretable_numerics.cpp" -o "$tmp_path/interpretable_numerics.o"
${CXX} -c ${CPPFLAGS} ${CXXFLAGS} ${extras} "$code_path/PartitionOneDimensionalBoosting.cpp" -o "$tmp_path/PartitionOneDimensionalBoosting.o"
${CXX} -c ${CPPFLAGS} ${CXXFLAGS} ${extras} "$code_path/PartitionRandomBoosting.cpp" -o "$tmp_path/PartitionRandomBoosting.o"
${CXX} -c ${CPPFLAGS} ${CXXFLAGS} ${extras} "$code_path/PartitionMultiDimensionalCorner.cpp" -o "$tmp_path/PartitionMultiDimensionalCorner.o"
${CXX} -c ${CPPFLAGS} ${CXXFLAGS} ${extras} "$code_path/PartitionMultiDimensionalTree.cpp" -o "$tmp_path/PartitionMultiDimensionalTree.o"
${CXX} -c ${CPPFLAGS} ${CXXFLAGS} ${extras} "$code_path/PartitionMultiDimensionalStraight.cpp" -o "$tmp_path/PartitionMultiDimensionalStraight.o"
${CXX} -c ${CPPFLAGS} ${CXXFLAGS} ${extras} "$code_path/Purify.cpp" -o "$tmp_path/Purify.o"
Expand Down Expand Up @@ -381,6 +382,7 @@ if [ $is_conda -eq 1 ]; then
"$tmp_path/interpretable_numerics.o" \
"$tmp_path/PartitionOneDimensionalBoosting.o" \
"$tmp_path/PartitionRandomBoosting.o" \
"$tmp_path/PartitionMultiDimensionalCorner.o" \
"$tmp_path/PartitionMultiDimensionalTree.o" \
"$tmp_path/PartitionMultiDimensionalStraight.o" \
"$tmp_path/Purify.o" \
Expand Down
1 change: 1 addition & 0 deletions python/interpret-core/interpret/develop.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"learning_rate_scale": 1.0,
"max_cat_threshold": 9223372036854775807,
"cat_include": 1.0,
"boost_corners": False,
"purify_boosting": False,
"purify_result": False,
"randomize_initial_feature_order": True,
Expand Down
2 changes: 2 additions & 0 deletions python/interpret-core/interpret/glassbox/_ebm/_ebm.py
Original file line number Diff line number Diff line change
Expand Up @@ -957,6 +957,8 @@ def fit(self, X, y, sample_weight=None, bags=None, init_score=None):
term_boost_flags = Native.TermBoostFlags_Default
if develop.get_option("purify_boosting"):
term_boost_flags |= Native.TermBoostFlags_PurifyUpdate
if develop.get_option("boost_corners"):
term_boost_flags |= Native.TermBoostFlags_Corners
inner_bags = self.inner_bags
greedy_ratio = self.greedy_ratio
smoothing_rounds = self.smoothing_rounds
Expand Down
1 change: 1 addition & 0 deletions python/interpret-core/interpret/utils/_native.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class Native:
TermBoostFlags_MissingLow = 0x00000080
TermBoostFlags_MissingHigh = 0x00000100
TermBoostFlags_MissingSeparate = 0x00000200
TermBoostFlags_Corners = 0x00000400

# CreateInteractionFlags
CreateInteractionFlags_Default = 0x00000000
Expand Down
Loading

0 comments on commit 1d45042

Please sign in to comment.