Skip to content

Commit

Permalink
Fix python api
Browse files Browse the repository at this point in the history
Signed-off-by: Adam Li <[email protected]>
  • Loading branch information
adam2392 committed Feb 3, 2023
1 parent c30f54d commit 90b4a55
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sklearn/tree/_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,10 @@ def fit(self, X, y=None, sample_weight=None, check_input=True):
# csr.
check_X_params = dict(dtype=DTYPE, accept_sparse="csc")
check_y_params = dict(ensure_2d=False, dtype=None)
X = self._validate_data(X, validate_separately=check_X_params)
if y is not None:
y = self._validate_data(y, validate_separately=check_y_params)
X, y = self._validate_data(X, y, validate_separately=(check_X_params, check_y_params))
else:
X = self._validate_data(X, **check_X_params)
if issparse(X):
X.sort_indices()

Expand Down

0 comments on commit 90b4a55

Please sign in to comment.