Skip to content

Commit

Permalink
Move data validation check (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
reidjohnson authored Aug 3, 2024
1 parent b396aff commit 183142a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion quantile_forest/_quantile_forest.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,10 @@ def fit(self, X, y, sample_weight=None, sparse_pickle=False):
"max_samples_leaf must be of integer, float, or None type, got "
f"{self.max_samples_leaf}."
)
X, y = self._validate_data(X, y, multi_output=True, accept_sparse="csc", dtype=DTYPE)
super(BaseForestQuantileRegressor, self).fit(X, y, sample_weight=sample_weight)
X, y = self._validate_data(
X, y, multi_output=True, accept_sparse="csc", dtype=DTYPE, force_all_finite=False
)

if y.ndim == 1:
y = np.expand_dims(y, axis=1)
Expand Down

0 comments on commit 183142a

Please sign in to comment.