Skip to content

Commit 76f7953

Browse files
authored
Fix future warning (#150)
1 parent bda06e0 commit 76f7953

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

hiclass/HierarchicalClassifier.py

+9-6
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,18 @@
1111
from joblib import Parallel, delayed
1212
from sklearn.base import BaseEstimator
1313
from sklearn.linear_model import LogisticRegression
14-
from sklearn.utils.validation import _check_sample_weight
15-
from sklearn.utils.validation import check_array, check_is_fitted
14+
from sklearn.utils.validation import (
15+
_check_sample_weight,
16+
check_array,
17+
check_is_fitted,
18+
validate_data,
19+
)
1620

1721
from hiclass.probability_combiner import (
18-
GeometricMeanCombiner,
1922
ArithmeticMeanCombiner,
23+
GeometricMeanCombiner,
2024
MultiplyCombiner,
2125
)
22-
2326
from hiclass.probability_combiner import (
2427
init_strings as probability_combiner_init_strings,
2528
)
@@ -173,8 +176,8 @@ def _pre_fit(self, X, y, sample_weight):
173176
# Check that X and y have correct shape
174177
# and convert them to np.ndarray if need be
175178

176-
self.X_, self.y_ = self._validate_data(
177-
X, y, multi_output=True, accept_sparse="csr", allow_nd=True
179+
self.X_, self.y_ = validate_data(
180+
self, X, y, multi_output=True, accept_sparse="csr", allow_nd=True
178181
)
179182

180183
if sample_weight is not None:

0 commit comments

Comments
 (0)