Skip to content

Commit b41b676

Browse files
committed
Updated intro and lmnn doc
1 parent f885031 commit b41b676

File tree

2 files changed

+28
-9
lines changed

2 files changed

+28
-9
lines changed

doc/source/algorithms.rst

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,21 @@
11
Large Margin Nearest Neighbor (LMNN)
22
=====================================
33

4-
todo: Brief desciption or a link.
4+
LMNN learns a Mahanalobis distance metric in the kNN classification setting by semidefinite programming. The learned distance metric enforces the k-nearest neighbors to always belong to the same class while examples from different classes are separated by a large margin. This algorithm makes no assumptions about the distribution of the data.
55

66
Example Code
77
------------------
8-
Using two different implementations:
9-
8+
We use iris data here for all the examples:
109
::
10+
from sklearn.datasets import load_iris
11+
12+
iris_data = load_iris()
13+
self.iris_points = iris_data['data']
14+
self.iris_labels = iris_data['target']
15+
np.random.seed(1234)
1116

17+
In this package, we have two different implementations of LMNN. Here we try both implementations in a for loop:
18+
::
1219
for LMNN_cls in set((LMNN, python_LMNN)):
1320
lmnn = LMNN_cls(k=k, learn_rate=1e-6)
1421
lmnn.fit(self.iris_points, self.iris_labels, verbose=False)
@@ -18,6 +25,7 @@ Using two different implementations:
1825

1926
References
2027
------------------
28+
`Link Distance Metric Learning for Large Margin Nearest Neighbor Classification <http://papers.nips.cc/paper/2795-distance-metric-learning-for-large-margin-nearest-neighbor-classification>`_ Kilian Q. Weinberger, John Blitzer, Lawrence K. Saul
2129

2230

2331

@@ -74,3 +82,14 @@ Example Code
7482
References
7583
------------------
7684

85+
86+
87+
Relative Components Analysis (RCA)
88+
=====================================
89+
90+
Example Code
91+
------------------
92+
93+
References
94+
------------------
95+

doc/source/intro.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
Introduction
1+
metric-learn: Metric Learning in Python
22
=====================================
3+
|License| |PyPI version|
34

4-
|Travis-CI Build Status| |License|
5-
6-
Metric Learning algorithms in Python.
5+
Distance metric is widely used in the machine learning literature. We used to choose a distance metric according to a priori (Euclidean Distance , L1 Distance, etc.) or according to the result of cross validation within small class of functions (e.g. choosing order of polynomial for a kernel). Actually, with priori knowledge of the data, we could learn a more suitable distance metric with metric learning techniques. metric-learn contains implementations of the state-of-the-art algorithms for metric learning. These metric learning methods are widely applied in feature extraction, dimensionality reduction, clustering, classification, information retrieval, and computer vision problems.
76

87
**Algorithms**
98

@@ -13,6 +12,7 @@ Metric Learning algorithms in Python.
1312
- Least Squares Metric Learning (LSML)
1413
- Neighborhood Components Analysis (NCA)
1514
- Local Fisher Discriminant Analysis (LFDA)
15+
- Relative Components Analysis (RCA)
1616

1717
**Dependencies**
1818

@@ -63,7 +63,7 @@ more complete.
6363

6464
.. _this site: http://www.cs.cmu.edu/~liuy/distlearn.htm
6565

66-
.. |Travis-CI Build Status| image:: https://api.travis-ci.org/all-umass/metric-learn.svg?branch=master
67-
:target: https://travis-ci.org/all-umass/metric-learn
66+
.. |PyPI version| image:: https://badge.fury.io/py/metric-learn.svg
67+
:target: http://badge.fury.io/py/metric-learn
6868
.. |License| image:: http://img.shields.io/:license-mit-blue.svg?style=flat
6969
:target: http://badges.mit-license.org

0 commit comments

Comments
 (0)