Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
scikit-learn
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ian Johnson
scikit-learn
Commits
0074331e
Commit
0074331e
authored
13 years ago
by
Mathieu Blondel
Browse files
Options
Downloads
Patches
Plain Diff
Update svmlight loader documentation.
parent
ae3b9439
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
doc/datasets/index.rst
+8
-6
8 additions, 6 deletions
doc/datasets/index.rst
with
8 additions
and
6 deletions
doc/datasets/index.rst
+
8
−
6
View file @
0074331e
...
...
@@ -104,21 +104,21 @@ can be used to build artifical datasets of controled size and complexity.
Datasets in svmlight / libsvm format
====================================
scikit-learn includes
a fast
utility function
, ``load_svmlight_format``, to
load
scikit-learn includes utility function
s for
load
ing
datasets in the svmlight / libsvm format. In this format, each line
takes the form ``<label> <feature-id>:<feature-value>
<feature-id>:<feature-value> ...``. This format is especially suitable for sparse datasets.
S
cipy sparse CSR matrices are used for ``X`` and numpy arrays are used for ``y``.
In this module, s
cipy sparse CSR matrices are used for ``X`` and numpy arrays are used for ``y``.
You may load a dataset like
thi
s::
You may load a dataset like
as follow
s::
>>> from sklearn.datasets import load_svmlight_file
>>> X_train, y_train = load_svmlight_file("/path/to/train_dataset.txt")
... # doctest: +SKIP
You may also load two datasets at once::
You may also load two
(or more)
datasets at once::
>>> X_train, y_train, X_test, y_test = load_svmlight_file(
>>> X_train, y_train, X_test, y_test = load_svmlight_file
s
(
... "/path/to/train_dataset.txt",
... "/path/to/test_dataset.txt") # doctest: +SKIP
...
...
@@ -130,10 +130,12 @@ features::
... "/path/to/test_dataset.txt", n_features=X_train.shape[1])
... # doctest: +SKIP
.. topic::
Public dataset
s:
.. topic::
Related link
s:
_`Public datasets in svmlight / libsvm format`: http://www.csie.ntu.edu.tw/~cjlin/libsvmtools/datasets/
_`Faster API-compatible implementation`: https://github.com/mblondel/svmlight-loader
.. include:: olivetti_faces.rst
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment