8000 don't use deprecated NotAnArray · scikit-learn/scikit-learn@e0f239e · GitHub
[go: up one dir, main page]

Skip to content

Commit e0f239e

Browse files
committed
don't use deprecated NotAnArray
1 parent 92c17b0 commit e0f239e

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

sklearn/utils/estimator_checks.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -726,17 +726,17 @@ def check_sample_weights_pandas_series(name, estimator_orig):
726726
@ignore_warnings(category=(DeprecationWarning, FutureWarning))
727727
def check_sample_weights_not_an_array(name, estimator_orig):
728728
# check that estimators will accept a 'sample_weight' parameter of
729-
# type NotAnArray in the 'fit' function.
729+
# type _NotAnArray in the 'fit' function.
730730
estimator = clone(estimator_orig)
731731
if has_fit_parameter(estimator, "sample_weight"):
732732
X = np.array([[1, 1], [1, 2], [1, 3], [1, 4],
733733
[2, 1], [2, 2], [2, 3], [2, 4],
734734
[3, 1], [3, 2], [3, 3], [3, 4]])
735-
X = NotAnArray(pairwise_estimator_convert_X(X, estimator_orig))
736-
y = NotAnArray([1, 1, 1, 1, 2, 2, 2, 2, 1, 1, 2, 2])
737-
weights = NotAnArray([1] * 12)
735+
X = _NotAnArray(pairwise_estimator_convert_X(X, estimator_orig))
736+
y = _NotAnArray([1, 1, 1, 1, 2, 2, 2, 2, 1, 1, 2, 2])
737+
weights = _NotAnArray([1] * 12)
738738
if _safe_tags(estimator, "multioutput_only"):
739-
y = NotAnArray(y.data.reshape(-1, 1))
739+
y = _NotAnArray(y.data.reshape(-1, 1))
740740
estimator.fit(X, y, sample_weight=weights)
741741

742742

@@ -1185,8 +1185,8 @@ def _check_transformer(name, transformer_orig, X, y):
11851185
if name in CROSS_DECOMPOSITION:
11861186
y_ = np.c_[np.asarray(y), np.asarray(y)]
11871187
y_[::2, 1] *= 2
1188-
if isinstance(X, NotAnArray):
1189-
y_ = NotAnArray(y_)
1188+
if isinstance(X, _NotAnArray):
1189+
y_ = _NotAnArray(y_)
11901190
else:
11911191
y_ = y
11921192

0 commit comments

Comments
 (0)
0