|
1 | | -[](https://travis-ci.org/all-umass/metric_learn) |
2 | | -[](http://badges.mit-license.org) |
| 1 | +|Travis-CI Build Status| |License| |
3 | 2 |
|
4 | | -# metric_learn |
| 3 | +metric-learn |
| 4 | +============= |
5 | 5 |
|
6 | 6 | Metric Learning algorithms in Python. |
7 | 7 |
|
8 | 8 | **Algorithms** |
9 | 9 |
|
10 | | - * Large Margin Nearest Neighbor (LMNN) |
11 | | - * Information Theoretic Metric Learning (ITML) |
12 | | - * Sparse Determinant Metric Learning (SDML) |
13 | | - * Least Squares Metric Learning (LSML) |
14 | | - * Neighborhood Components Analysis (NCA) |
| 10 | +- Large Margin Nearest Neighbor (LMNN) |
| 11 | +- Information Theoretic Metric Learning (ITML) |
| 12 | +- Sparse Determinant Metric Learning (SDML) |
| 13 | +- Least Squares Metric Learning (LSML) |
| 14 | +- Neighborhood Components Analysis (NCA) |
15 | 15 |
|
16 | 16 | **Dependencies** |
17 | 17 |
|
18 | | - * Python 2.6+ |
19 | | - * numpy, scipy, scikit-learn |
20 | | - * (for running the examples only: matplotlib) |
| 18 | +- Python 2.6+ |
| 19 | +- numpy, scipy, scikit-learn |
| 20 | +- (for running the examples only: matplotlib) |
21 | 21 |
|
22 | 22 | **Installation/Setup** |
23 | 23 |
|
24 | | -Run `python setup.py install` for default installation. |
| 24 | +Run ``python setup.py install`` for default installation. |
25 | 25 |
|
26 | | -Run `python setup.py test` to run all tests. |
| 26 | +Run ``python setup.py test`` to run all tests. |
27 | 27 |
|
28 | 28 | **Usage** |
29 | 29 |
|
30 | | -For full usage examples, see the `test` and `examples` directories. |
| 30 | +For full usage examples, see the ``test`` and ``examples`` directories. |
31 | 31 |
|
32 | | -Each metric is a subclass of `BaseMetricLearner`, |
33 | | -which provides default implementations for the methods |
34 | | -`metric`, `transformer`, and `transform`. |
35 | | -Subclasses must provide an implementation for either `metric` or `transformer`. |
| 32 | +Each metric is a subclass of ``BaseMetricLearner``, which provides |
| 33 | +default implementations for the methods ``metric``, ``transformer``, and |
| 34 | +``transform``. Subclasses must provide an implementation for either |
| 35 | +``metric`` or ``transformer``. |
36 | 36 |
|
37 | | -For an instance of a metric learner named `foo` learning from a set of `d`-dimensional points, |
38 | | -`foo.metric()` returns a `d` by `d` matrix `M` such that a distance between vectors `x` and `y` is |
39 | | -expressed `(x-y).dot(M).dot(x-y)`. |
| 37 | +For an instance of a metric learner named ``foo`` learning from a set of |
| 38 | +``d``-dimensional points, ``foo.metric()`` returns a ``d`` by ``d`` |
| 39 | +matrix ``M`` such that a distance between vectors ``x`` and ``y`` is |
| 40 | +expressed ``(x-y).dot(M).dot(x-y)``. |
40 | 41 |
|
41 | | -In the same scenario, `foo.transformer()` returns a `d` by `d` matrix `L` such that a vector `x` |
42 | | -can be represented in the learned space as the vector `L.dot(x)`. |
| 42 | +In the same scenario, ``foo.transformer()`` returns a ``d`` by ``d`` |
| 43 | +matrix ``L`` such that a vector ``x`` can be represented in the learned |
| 44 | +space as the vector ``L.dot(x)``. |
43 | 45 |
|
44 | | -For convenience, the function `foo.transform(X)` is provided for converting a matrix of points (`X`) |
45 | | -into the learned space, in which standard Euclidean distance can be used. |
| 46 | +For convenience, the function ``foo.transform(X)`` is provided for |
| 47 | +converting a matrix of points (``X``) into the learned space, in which |
| 48 | +standard Euclidean distance can be used. |
46 | 49 |
|
47 | 50 | **Notes** |
48 | 51 |
|
49 | | -If a recent version of the Shogun Python modular (`modshogun`) library is available, |
50 | | -the LMNN implementation will use the fast C++ version from there. |
51 | | -The two implementations differ slightly, and the C++ version is more complete. |
| 52 | +If a recent version of the Shogun Python modular (``modshogun``) library |
| 53 | +is available, the LMNN implementation will use the fast C++ version from |
| 54 | +there. The two implementations differ slightly, and the C++ version is |
| 55 | +more complete. |
52 | 56 |
|
53 | | -*TODO: implement the rest of the methods on |
54 | | -[this site](http://www.cs.cmu.edu/~liuy/distlearn.htm)* |
| 57 | +**TODO** |
| 58 | + |
| 59 | +- implement the rest of the methods on `this site`_ |
| 60 | + |
| 61 | +.. _this site: http://www.cs.cmu.edu/~liuy/distlearn.htm |
| 62 | + |
| 63 | +.. |Travis-CI Build Status| image:: https://api.travis-ci.org/all-umass/metric_learn.svg?branch=master |
| 64 | + :target: https://travis-ci.org/all-umass/metric_learn |
| 65 | +.. |License| image:: http://img.shields.io/:license-mit-blue.svg?style=flat |
| 66 | + :target: http://badges.mit-license.org |
0 commit comments