Skip to content

Commit

Permalink
feat(ensemble): add various available splitters for GB [cd build]
Browse files Browse the repository at this point in the history
  • Loading branch information
simonprovost committed Jul 31, 2024
1 parent 21443b9 commit 6373543
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "scikit-lexicographical-trees"
version = "0.0.2"
version = "0.0.3"
description = "A set of python modules for machine learning and data mining"
readme = "README.rst"
maintainers = [
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@


# VERSION = sklearn.__version__
VERSION = "0.0.2"
VERSION = "0.0.3"

# Custom clean command to remove build artifacts

Expand Down
10 changes: 9 additions & 1 deletion sklearn/ensemble/_gb.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,9 @@ def __init__(
validation_fraction=0.1,
n_iter_no_change=None,
tol=1e-4,
splitter="best",
feature_groups=None,
threshold_gain=0.0015,
):
self.n_estimators = n_estimators
self.learning_rate = learning_rate
Expand All @@ -416,6 +419,9 @@ def __init__(
self.validation_fraction = validation_fraction
self.n_iter_no_change = n_iter_no_change
self.tol = tol
self.splitter = splitter
self.feature_groups = feature_groups
self.threshold_gain = threshold_gain

@abstractmethod
def _encode_y(self, y=None, sample_weight=None):
Expand Down Expand Up @@ -470,7 +476,7 @@ def _fit_stage(
# induce regression tree on the negative gradient
tree = DecisionTreeRegressor(
criterion=self.criterion,
splitter="best",
splitter=self.splitter,
max_depth=self.max_depth,
min_samples_split=self.min_samples_split,
min_samples_leaf=self.min_samples_leaf,
Expand All @@ -480,6 +486,8 @@ def _fit_stage(
max_leaf_nodes=self.max_leaf_nodes,
random_state=random_state,
ccp_alpha=self.ccp_alpha,
threshold_gain=self.threshold_gain,
features_group=self.feature_groups,
)

if self.subsample < 1.0:
Expand Down

0 comments on commit 6373543

Please sign in to comment.