8000 TST remove tests for default change warnings in test_svm.py by iasoon · Pull Request #23030 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content

TST remove tests for default change warnings in test_svm.py #23030

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 4, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 1 addition & 22 deletions sklearn/svm/tests/test_svm.py
Original file line number Diff line number Diff line change
Expand Up @@ -1331,34 +1331,13 @@ def test_svc_ovr_tie_breaking(SVCClass):
assert np.all(pred == np.argmax(dv, axis=1))


def test_gamma_auto():
X, y = [[0.0, 1.2], [1.0, 1.3]], [0, 1]

with pytest.warns(None) as record:
svm.SVC(kernel="linear").fit(X, y)
assert not [w.message for w in record]

with pytest.warns(None) as record:
svm.SVC(kernel="precomputed").fit(X, y)
assert not [w.message for w in record]


def test_gamma_scale():
X, y = [[0.0], [1.0]], [0, 1]

clf = svm.SVC()
with pytest.warns(None) as record:
clf.fit(X, y)
assert not [w.message for w in record]
clf.fit(X, y)
assert_almost_equal(clf._gamma, 4)

# X_var ~= 1 shouldn't raise warning, for when
# gamma is not explicitly set.
X, y = [[1, 2], [3, 2 * np.sqrt(6) / 3 + 2]], [0, 1]
with pytest.warns(None) as record:
clf.fit(X, y)
assert not [w.message for w in record]


@pytest.mark.parametrize(
"SVM, params",
Expand Down
0