Skip to content

Commit aa5c639

Browse files
committed
moved casting of y as array to main
1 parent 93d8551 commit aa5c639

File tree

2 files changed

+1
-9
lines changed

2 files changed

+1
-9
lines changed

src/linearboost/linear_boost.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,10 +282,10 @@ def fit(self, X, y, sample_weight=None) -> Self:
282282
clone(_scalers[self.scaler]), clone(_scalers["minmax"])
283283
)
284284
X_transformed = self.scaler_.fit_transform(X)
285+
y = np.asarray(y)
285286

286287
if sample_weight is not None:
287288
sample_weight = np.asarray(sample_weight)
288-
y = np.asarray(y)
289289
if sample_weight.shape[0] != X_transformed.shape[0]:
290290
raise ValueError(
291291
f"sample_weight.shape == {sample_weight.shape} is incompatible with X.shape == {X_transformed.shape}"

tests/test_linearboost.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,6 @@
55
from ._utils import check_estimator, get_expected_failed_tests, _yield_all_checks
66

77

8-
def get_expected_failed_tests(estimator):
9-
failed = []
10-
for check in _yield_all_checks(estimator):
11-
if check.__name__ == "check_sample_weights_invariance":
12-
failed.append(check)
13-
return failed
14-
15-
168
def test_linear_boost_estimator():
179
"""
1810
Test whether `LinearBoostClassifier` adheres to scikit-learn conventions.

0 commit comments

Comments
 (0)