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
5d2a7fd1
Commit
5d2a7fd1
authored
14 years ago
by
Olivier Grisel
Browse files
Options
Downloads
Patches
Plain Diff
small fixes
parent
a45a01ed
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
examples/mlcomp_document_classification.py
+2
-2
2 additions, 2 deletions
examples/mlcomp_document_classification.py
scikits/learn/datasets/mlcomp.py
+2
-4
2 additions, 4 deletions
scikits/learn/datasets/mlcomp.py
with
4 additions
and
6 deletions
examples/mlcomp_document_classification.py
+
2
−
2
View file @
5d2a7fd1
...
...
@@ -58,9 +58,9 @@ print "done in %fs" % (time() - t0)
# The documents have been hashed into TF-IDF (Term Frequencies times Inverse
# Document Frequencies) vectors of a fixed dimension.
# Currently most scikits.learn wrappers or algorithm implementations are unable
# to leverage efficiently a sparse datastracture; hence we use
of a this
dense
# to leverage efficiently a sparse datastracture; hence we use
a
dense
# representation of a text dataset. Efficient handling of sparse data
# structures should be expected
for
in an upcoming version of scikits.learn
# structures should be expected in an upcoming version of scikits.learn
print
"
n_samples: %d, n_features: %d
"
%
news_train
.
data
.
shape
print
"
Training a linear classification model with L1 penalty...
"
...
...
This diff is collapsed.
Click to expand it.
scikits/learn/datasets/mlcomp.py
+
2
−
4
View file @
5d2a7fd1
...
...
@@ -8,7 +8,7 @@ from scikits.learn.datasets.base import Bunch
from
scikits.learn.features.text
import
HashingVectorizer
def
load_document_classification
(
dataset_path
,
metadata
,
set_
,
**
kw
):
def
_
load_document_classification
(
dataset_path
,
metadata
,
set_
,
**
kw
):
"""
Loader implementation for the DocumentClassification format
"""
target
=
[]
target_names
=
{}
...
...
@@ -39,7 +39,7 @@ def load_document_classification(dataset_path, metadata, set_, **kw):
LOADERS
=
{
'
DocumentClassification
'
:
load_document_classification
,
'
DocumentClassification
'
:
_
load_document_classification
,
# TODO: implement the remaining domain formats
}
...
...
@@ -127,5 +127,3 @@ def load_mlcomp(name_or_id, set_="raw", mlcomp_root=None, **kwargs):
return
loader
(
dataset_path
,
metadata
,
set_
=
set_
,
**
kwargs
)
if
__name__
==
"
__main__
"
:
twentynews
=
load_mlcomp
(
'
20news-18828
'
)
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