Skip to content

Commit

Permalink
save n_classes_
Browse files Browse the repository at this point in the history
  • Loading branch information
csinva committed Aug 25, 2023
1 parent 02f0e9d commit 2317acc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions imodels/algebraic/tree_gam.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ def fit(self, X, y, sample_weight=None):
X, y = check_X_y(X, y, accept_sparse=False, multi_output=False)
if isinstance(self, ClassifierMixin):
check_classification_targets(y)
self.classes_, y = np.unique(y, return_inverse=True)

sample_weight = _check_sample_weight(sample_weight, X, dtype=None)

# split into train and validation for early stopping
Expand Down

0 comments on commit 2317acc

Please sign in to comment.