Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[MRG+1] supress deprecation warnings for non_negative option #9356

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 3 commits into from
Jul 15, 2017
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions sklearn/feature_extraction/tests/test_feature_hasher.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ def test_feature_hasher_dicts():
assert_array_equal(X1.toarray(), X2.toarray())


@ignore_warnings(category=DeprecationWarning)
def test_feature_hasher_strings():
# mix byte and Unicode strings; note that "foo" is a duplicate in row 0
raw_X = [["foo", "bar", "baz", "foo".encode("ascii")],
Expand Down
6 changes: 5 additions & 1 deletion sklearn/feature_extraction/tests/test_text.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
assert_not_equal, assert_almost_equal,
assert_in, assert_less, assert_greater,
assert_warns_message, assert_raise_message,
clean_warning_registry, SkipTest)
clean_warning_registry, ignore_warnings,
SkipTest)

from collections import defaultdict, Mapping
from functools import partial
Expand Down Expand Up @@ -480,6 +481,7 @@ def test_tfidf_vectorizer_setters():
assert_true(tv._tfidf.sublinear_tf)


@ignore_warnings(category=DeprecationWarning)
def test_hashing_vectorizer():
v = HashingVectorizer()
X = v.transform(ALL_FOOD_DOCS)
Expand Down Expand Up @@ -651,6 +653,7 @@ def test_count_binary_occurrences():
assert_equal(X_sparse.dtype, np.float32)


@ignore_warnings(category=DeprecationWarning)
def test_hashed_binary_occurrences():
# by default multiple occurrences are counted as longs
test_data = ['aaabc', 'abbde']
Expand Down Expand Up @@ -784,6 +787,7 @@ def test_vectorizer_pipeline_cross_validation():
assert_array_equal(cv_scores, [1., 1., 1.])


@ignore_warnings(category=DeprecationWarning)
def test_vectorizer_unicode():
# tests that the count vectorizer works with cyrillic.
document = (
Expand Down