Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX correct the invoke of oblique trees by feature combinations #347

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions treeple/tree/_multiview.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,14 @@ class MultiViewDecisionTreeClassifier(SimMatrixMixin, DecisionTreeClassifier):
through the fit method) if sample_weight is specified.

feature_combinations : float, default=None
Not used.
The number of features to combine on average at each split
of the decision trees. If ``None``, then will default to the minimum of
1. This controls the number of non-zeros is the
projection matrix. Setting the value to 1.0 is equivalent to a
traditional decision-tree. ``feature_combinations * max_features``
gives the number of expected non-zeros in the projection matrix of shape
``(max_features, n_features)``. Thus this value must always be less than
``n_features`` in order to be valid.

ccp_alpha : non-negative float, default=0.0
Not used.
Expand Down Expand Up @@ -303,7 +310,7 @@ def __init__(
monotonic_cst=monotonic_cst,
)

self.feature_combinations = feature_combinations
self.feature_combinations = 1 if feature_combinations is None else feature_combinations
self.feature_set_ends = feature_set_ends
self.apply_max_features_per_feature_set = apply_max_features_per_feature_set
self._max_features_arr = None
Expand Down Expand Up @@ -364,7 +371,7 @@ def _build_tree(
self.monotonic_cst_ = monotonic_cst
_, n_features = X.shape

self.feature_combinations_ = 1
self.feature_combinations_ = self.feature_combinations

# Build tree
criterion = self.criterion
Expand Down
Loading