Skip to content

Commit 22f60dd

Browse files
wdevazelhesbellet
authored andcommitted
[MRG] Add documentation for supervised classes and add __init__ docstrings to doc (#115)
* FEAT: Add documentation for supervised classes * Add doc for ITML, and put mlkr to the right place in index * FIX: update doc * FIX: add __init__ docstrings in doc * FIX: Update doc to suit regression too * STY: add points at end of docstrings * MAINT: address #115 (review) * DOC: fix semi to weakly supervised
1 parent c5f3175 commit 22f60dd

16 files changed

+82
-19
lines changed

doc/index.rst

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,45 @@ metrics.
1313
This package contains efficient Python implementations of several popular
1414
metric learning algorithms.
1515

16+
Supervised Algorithms
17+
---------------------
18+
Supervised metric learning algorithms take as inputs points `X` and target
19+
labels `y`, and learn a distance matrix that make points from the same class
20+
(for classification) or with close target value (for regression) close to
21+
each other, and points from different classes or with distant target values
22+
far away from each other.
23+
1624
.. toctree::
17-
:caption: Algorithms
1825
:maxdepth: 1
1926

2027
metric_learn.covariance
2128
metric_learn.lmnn
22-
metric_learn.itml
23-
metric_learn.sdml
24-
metric_learn.lsml
2529
metric_learn.nca
2630
metric_learn.lfda
31+
metric_learn.mlkr
32+
33+
Weakly-Supervised Algorithms
34+
--------------------------
35+
Weakly supervised algorithms work on weaker information about the data points
36+
than supervised algorithms. Rather than labeled points, they take as input
37+
similarity judgments on tuples of data points, for instance pairs of similar
38+
and dissimilar points. Refer to the documentation of each algorithm for its
39+
particular form of input data.
40+
41+
.. toctree::
42+
:maxdepth: 1
43+
44+
metric_learn.itml
45+
metric_learn.lsml
46+
metric_learn.sdml
2747
metric_learn.rca
2848
metric_learn.mmc
29-
metric_learn.mlkr
3049

31-
Each metric supports the following methods:
50+
Note that each weakly-supervised algorithm has a supervised version of the form
51+
`*_Supervised` where similarity constraints are generated from
52+
the labels information and passed to the underlying algorithm.
53+
54+
Each metric learning algorithm supports the following methods:
3255

3356
- ``fit(...)``, which learns the model.
3457
- ``transformer()``, which returns a transformation matrix

doc/metric_learn.covariance.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Covariance metric (baseline method)
66
:undoc-members:
77
:inherited-members:
88
:show-inheritance:
9+
:special-members: __init__
910

1011
Example Code
1112
------------

doc/metric_learn.itml.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Information Theoretic Metric Learning (ITML)
66
:undoc-members:
77
:inherited-members:
88
:show-inheritance:
9+
:special-members: __init__
910

1011
Example Code
1112
------------

doc/metric_learn.lfda.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Local Fisher Discriminant Analysis (LFDA)
66
:undoc-members:
77
:inherited-members:
88
:show-inheritance:
9+
:special-members: __init__
910

1011
Example Code
1112
------------

doc/metric_learn.lmnn.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Large Margin Nearest Neighbor (LMNN)
66
:undoc-members:
77
:inherited-members:
88
:show-inheritance:
9+
:special-members: __init__
910

1011
Example Code
1112
------------

doc/metric_learn.lsml.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Least Squares Metric Learning (LSML)
66
:undoc-members:
77
:inherited-members:
88
:show-inheritance:
9+
:special-members: __init__
910

1011
Example Code
1112
------------

doc/metric_learn.mlkr.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Metric Learning for Kernel Regression (MLKR)
66
:undoc-members:
77
:inherited-members:
88
:show-inheritance:
9+
:special-members: __init__
910

1011
Example Code
1112
------------

doc/metric_learn.mmc.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Mahalanobis Metric Learning for Clustering (MMC)
66
:undoc-members:
77
:inherited-members:
88
:show-inheritance:
9+
:special-members: __init__
910

1011
Example Code
1112
------------

doc/metric_learn.nca.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Neighborhood Components Analysis (NCA)
66
:undoc-members:
77
:inherited-members:
88
:show-inheritance:
9+
:special-members: __init__
910

1011
Example Code
1112
------------

doc/metric_learn.rca.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Relative Components Analysis (RCA)
66
:undoc-members:
77
:inherited-members:
88
:show-inheritance:
9+
:special-members: __init__
910

1011
Example Code
1112
------------

0 commit comments

Comments
 (0)