8000 MAINT Fix error on np.matrix usage in documentation (#24514) · scikit-learn/scikit-learn@7b0a162 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7b0a162

Browse files
authored
MAINT Fix error on np.matrix usage in documentation (#24514)
1 parent 9a76368 commit 7b0a162

File tree

2 files changed

+3
-4
lines changed

2 10000 files changed

+3
-4
lines changed

examples/semi_supervised/plot_semi_supervised_newsgroups.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
print()
4242

4343
# Parameters
44-
sdg_params = dict(alpha=1e-5, penalty="l2", loss="log")
44+
sdg_params = dict(alpha=1e-5, penalty="l2", loss="log_loss")
4545
vectorizer_params = dict(ngram_range=(1, 2), min_df=5, max_df=0.8)
4646

4747
# Supervised Pipeline
@@ -66,7 +66,7 @@
6666
("vect", CountVectorizer(**vectorizer_params)),
6767
("tfidf", TfidfTransformer()),
6868
# LabelSpreading does not support dense matrices
69-
("todense", FunctionTransformer(lambda x: x.todense())),
69+
("toarray", FunctionTransformer(lambda x: x.toarray())),
7070
("clf", LabelSpreading()),
7171
]
7272
)

sklearn/utils/validation.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -737,8 +737,7 @@ def check_array(
737737
raise TypeError(
738738
"np.matrix is not supported. Please convert to a numpy array with "
739739
"np.asarray. For more information see: "
740-
"https://numpy.org/doc/stable/reference/generated/numpy.matrix.html",
741-
FutureWarning,
740+
"https://numpy.org/doc/stable/reference/generated/numpy.matrix.html"
742741
)
743742

744743
xp, is_array_api = get_namespace(array)

0 commit comments

Comments
 (0)
0