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

Skip to content

Commit 4f22edf

Browse files
committed
FIX docstring of sklearn.datasets._svmlight_format_io.load_svmlight_file to pass docstring test
1 parent f0cbdc1 commit 4f22edf

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

sklearn/datasets/_svmlight_format_io.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def load_svmlight_file(
5353
offset=0,
5454
length=-1,
5555
):
56-
"""Load datasets in the svmlight / libsvm format into sparse CSR matrix
56+
"""Load datasets in the svmlight / libsvm format into sparse CSR matrix.
5757
5858
This format is a text-based format, with one sample per line. It does
5959
not store zero valued features hence is suitable for sparse dataset.
@@ -106,7 +106,7 @@ def load_svmlight_file(
106106
107107
multilabel : bool, default=False
108108
Samples may have several labels each (see
109-
https://www.csie.ntu.edu.tw/~cjlin/libsvmtools/datasets/multilabel.html)
109+
https://www.csie.ntu.edu.tw/~cjlin/libsvmtools/datasets/multilabel.html).
110110
111111
zero_based : bool or "auto", default="auto"
112112
Whether column indices in f are zero-based (True) or one-based
@@ -135,12 +135,14 @@ def load_svmlight_file(
135135
Returns
136136
-------
137137
X : scipy.sparse matrix of shape (n_samples, n_features)
138+
The data matrix.
138139
139-
y : ndarray of shape (n_samples,), or, in the multilabel a list of
140-
tuples of length n_samples.
140+
y : ndarray of shape (n_samples,), or a list of tuples of length n_samples
141+
The target. The output type depends on the value of the parameter
142+
``multilabel``.
141143
142144
query_id : array of shape (n_samples,)
143-
query_id for each sample. Only returned when query_id is set to
145+
The query_id for each sample. Only returned when query_id is set to
144146
True.
145147
146148
See Also

sklearn/tests/test_docstrings.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
FUNCTION_DOCSTRING_IGNORE_LIST = [
1515
"sklearn.datasets._lfw.fetch_lfw_people",
1616
"sklearn.datasets._species_distributions.fetch_species_distributions",
17-
"sklearn.datasets._svmlight_format_io.load_svmlight_file",
1817
"sklearn.datasets._svmlight_format_io.load_svmlight_files",
1918
"sklearn.decomposition._dict_learning.dict_learning",
2019
"sklearn.decomposition._dict_learning.dict_learning_online",

0 commit comments

Comments
 (0)