Skip to content

Commit 00f8216

Browse files
committed
FIX docstring of sklearn.datasets._svmlight_format_io.load_svmlight_files to pass docstring test
1 parent f0cbdc1 commit 00f8216

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed

sklearn/datasets/_svmlight_format_io.py

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ def load_svmlight_files(
230230
offset=0,
231231
length=-1,
232232
):
233-
"""Load dataset from multiple files in SVMlight format
233+
"""Load dataset from multiple files in SVMlight format.
234234
235235
This function is equivalent to mapping load_svmlight_file over a list of
236236
files, except that the results are concatenated into a single, flat list
@@ -268,7 +268,7 @@ def load_svmlight_files(
268268
269269
multilabel : bool, default=False
270270
Samples may have several labels each (see
271-
https://www.csie.ntu.edu.tw/~cjlin/libsvmtools/datasets/multilabel.html)
271+
https://www.csie.ntu.edu.tw/~cjlin/libsvmtools/datasets/multilabel.html).
272272
273273
zero_based : bool or "auto", default="auto"
274274
Whether column indices in f are zero-based (True) or one-based
@@ -296,23 +296,22 @@ def load_svmlight_files(
296296
297297
Returns
298298
-------
299-
[X1, y1, ..., Xn, yn]
300-
where each (Xi, yi) pair is the result from load_svmlight_file(files[i]).
299+
[X1, y1, ..., Xn, yn] or [X1, y1, q1, ..., Xn, yn, qn]: list of arrays
300+
Each (Xi, yi) pair is the result from load_svmlight_file(files[i]).
301+
If query_id is set to True, this will return instead (Xi, yi, qi)
302+
triplets.
301303
302-
If query_id is set to True, this will return instead [X1, y1, q1,
303-
..., Xn, yn, qn] where (Xi, yi, qi) is the result from
304-
load_svmlight_file(files[i])
304+
See Also
305+
--------
306+
load_svmlight_file: Similar function for loading a single file in this
307+
format.
305308
306309
Notes
307310
-----
308311
When fitting a model to a matrix X_train and evaluating it against a
309312
matrix X_test, it is essential that X_train and X_test have the same
310313
number of features (X_train.shape[1] == X_test.shape[1]). This may not
311314
be the case if you load the files individually with load_svmlight_file.
312-
313-
See Also
314-
--------
315-
load_svmlight_file
316315
"""
317316
if (offset != 0 or length > 0) and zero_based == "auto":
318317
# disable heuristic search to avoid getting inconsistent results on

sklearn/tests/test_docstrings.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
"sklearn.datasets._lfw.fetch_lfw_people",
1616
"sklearn.datasets._species_distributions.fetch_species_distributions",
1717
"sklearn.datasets._svmlight_format_io.load_svmlight_file",
18-
"sklearn.datasets._svmlight_format_io.load_svmlight_files",
1918
"sklearn.decomposition._dict_learning.dict_learning",
2019
"sklearn.decomposition._dict_learning.dict_learning_online",
2120
"sklearn.decomposition._nmf.non_negative_factorization",

0 commit comments

Comments
 (0)