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
ac803a5c
Commit
ac803a5c
authored
13 years ago
by
Robert Layton
Browse files
Options
Downloads
Patches
Plain Diff
Fixed values in Adjusted Mutual Information doctests
parent
cfeab0e8
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
doc/modules/clustering.rst
+5
-5
5 additions, 5 deletions
doc/modules/clustering.rst
with
5 additions
and
5 deletions
doc/modules/clustering.rst
+
5
−
5
View file @
ac803a5c
...
@@ -492,21 +492,21 @@ and **with chance normalization**::
...
@@ -492,21 +492,21 @@ and **with chance normalization**::
>>> labels_pred = [0, 0, 1, 1, 2, 2]
>>> labels_pred = [0, 0, 1, 1, 2, 2]
>>> metrics.adjusted_mutual_info_score(labels_true, labels_pred) # doctest: +ELLIPSIS
>>> metrics.adjusted_mutual_info_score(labels_true, labels_pred) # doctest: +ELLIPSIS
0.24...
0.2
250
4...
One can permute 0 and 1 in the predicted labels and rename `2` by `3` and get
One can permute 0 and 1 in the predicted labels and rename `2` by `3` and get
the same score::
the same score::
>>> labels_pred = [1, 1, 0, 0, 3, 3]
>>> labels_pred = [1, 1, 0, 0, 3, 3]
>>> metrics.adjusted_mutual_info_score(labels_true, labels_pred) # doctest: +ELLIPSIS
>>> metrics.adjusted_mutual_info_score(labels_true, labels_pred) # doctest: +ELLIPSIS
0.24...
0.2
250
4...
Furthermore, :func:`adjusted_mutual_info_score` is **symmetric**: swapping the
Furthermore, :func:`adjusted_mutual_info_score` is **symmetric**: swapping the
argument does not change the score. It can thus be used as a **consensus
argument does not change the score. It can thus be used as a **consensus
measure**::
measure**::
>>> metrics.adjusted_mutual_info_score(labels_pred, labels_true) # doctest: +ELLIPSIS
>>> metrics.adjusted_mutual_info_score(labels_pred, labels_true) # doctest: +ELLIPSIS
0.24...
0.2
250
4...
Perfect labeling is scored 1.0::
Perfect labeling is scored 1.0::
...
@@ -514,12 +514,12 @@ Perfect labeling is scored 1.0::
...
@@ -514,12 +514,12 @@ Perfect labeling is scored 1.0::
>>> metrics.adjusted_mutual_info_score(labels_true, labels_pred)
>>> metrics.adjusted_mutual_info_score(labels_true, labels_pred)
1.0
1.0
Bad (e.g. independent labelings) have
scores of zero
::
Bad (e.g. independent labelings) have
non-positive scores
::
>>> labels_true = [0, 1, 2, 0, 3, 4, 5, 1]
>>> labels_true = [0, 1, 2, 0, 3, 4, 5, 1]
>>> labels_pred = [1, 1, 0, 0, 2, 2, 2, 2]
>>> labels_pred = [1, 1, 0, 0, 2, 2, 2, 2]
>>> metrics.adjusted_mutual_info_score(labels_true, labels_pred) # doctest: +ELLIPSIS
>>> metrics.adjusted_mutual_info_score(labels_true, labels_pred) # doctest: +ELLIPSIS
0.
0
...
-
0.
10526
...
Advantages
Advantages
...
...
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