From 183142a3b6021a3f6d0e644e38d0f629f95ef60e Mon Sep 17 00:00:00 2001 From: Reid Johnson Date: Sat, 3 Aug 2024 01:37:11 -0700 Subject: [PATCH] Move data validation check (#71) --- quantile_forest/_quantile_forest.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/quantile_forest/_quantile_forest.py b/quantile_forest/_quantile_forest.py index 4aa70ef..f232bb3 100755 --- a/quantile_forest/_quantile_forest.py +++ b/quantile_forest/_quantile_forest.py @@ -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)