Skip to content

Commit

Permalink
Version bump to 0.3, updating docs
Browse files Browse the repository at this point in the history
  • Loading branch information
perimosocordiae committed Jul 13, 2016
1 parent ce5f238 commit 96a8abc
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 28 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Metric Learning algorithms in Python.

**Dependencies**

- Python 2.6+
- Python 2.7+, 3.4+
- numpy, scipy, scikit-learn
- (for running the examples only: matplotlib)

Expand Down
3 changes: 2 additions & 1 deletion doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ metric learning algorithms.
:caption: Algorithms
:maxdepth: 1

metric_learn.covariance
metric_learn.lmnn
metric_learn.itml
metric_learn.sdml
Expand Down Expand Up @@ -51,7 +52,7 @@ Alternately, download the source repository and run:

**Dependencies**

- Python 2.6+
- Python 2.7+, 3.4+
- numpy, scipy, scikit-learn
- (for running the examples only: matplotlib)

Expand Down
21 changes: 21 additions & 0 deletions doc/metric_learn.covariance.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Covariance metric (baseline method)
===================================

.. automodule:: metric_learn.covariance
:members:
:undoc-members:
:inherited-members:
:show-inheritance:

Example Code
------------

::

from metric_learn import Covariance
from sklearn.datasets import load_iris

iris_data = load_iris()

cov = Covariance()
x = cov.fit_transform(iris_data['data'])
10 changes: 3 additions & 7 deletions doc/metric_learn.itml.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,15 @@ Example Code

::

import numpy as np
from metric_learn import ITML
from metric_learn import ITML_Supervised
from sklearn.datasets import load_iris

iris_data = load_iris()
X = iris_data['data']
Y = iris_data['target']

itml = ITML()

num_constraints = 200
C = ITML.prepare_constraints(Y, X.shape[0], num_constraints)
itml.fit(X, C, verbose=False)
itml = ITML_Supervised(num_constraints=200)
itml.fit(X, Y)

References
----------
Expand Down
8 changes: 3 additions & 5 deletions doc/metric_learn.lsml.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,15 @@ Example Code

::

import numpy as np
from metric_learn import LSML
from metric_learn import LSML_Supervised
from sklearn.datasets import load_iris

iris_data = load_iris()
X = iris_data['data']
Y = iris_data['target']

lsml = LSML()
C = LSML.prepare_constraints(Y, 200)
isml.fit(X, C, verbose=False)
lsml = LSML_Supervised(num_constraints=200)
isml.fit(X, Y)

References
----------
Expand Down
8 changes: 3 additions & 5 deletions doc/metric_learn.rca.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,15 @@ Example Code

::

import numpy as np
from metric_learn import RCA
from metric_learn import RCA_Supervised
from sklearn.datasets import load_iris

iris_data = load_iris()
X = iris_data['data']
Y = iris_data['target']

rca = RCA()
C = RCA.prepare_constraints(Y, num_chunks=30, chunk_size=2)
rca.fit(X, C)
rca = RCA_Supervised(num_chunks=30, chunk_size=2)
rca.fit(X, Y)

References
------------------
Expand Down
8 changes: 3 additions & 5 deletions doc/metric_learn.sdml.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,15 @@ Example Code

::

import numpy as np
from metric_learn import SDML
from metric_learn import SDML_Supervised
from sklearn.datasets import load_iris

iris_data = load_iris()
X = iris_data['data']
Y = iris_data['target']

sdml = SDML()
W = SDML.prepare_constraints(Y, X.shape[0], 1500)
sdml.fit(X, W)
sdml = SDML_Supervised(num_constraints=200)
sdml.fit(X, Y)

References
------------------
3 changes: 2 additions & 1 deletion metric_learn/sdml.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ def fit(self, X, W):
"""
X: data matrix, (n x d)
each row corresponds to a single instance
W: connectivity graph, (n x n). +1 for positive pairs, -1 for negative.
W: connectivity graph, (n x n)
+1 for positive pairs, -1 for negative.
"""
self._prepare_inputs(X, W)
P = pinvh(self.M) + self.params['balance_param'] * self.loss_matrix
Expand Down
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-
from setuptools import setup

version = "0.2.1"
version = "0.3.0"
setup(name='metric-learn',
version=version,
description='Python implementations of metric learning algorithms',
Expand All @@ -26,12 +26,12 @@
'six'
],
extras_require=dict(
docs=['sphinx', 'numpydoc'],
docs=['sphinx', 'shinx_rtd_theme', 'numpydoc'],
demo=['matplotlib'],
),
test_suite='test',
keywords=[
'Metric Learning',
'Metric Learning',
'Large Margin Nearest Neighbor',
'Information Theoretic Metric Learning',
'Sparse Determinant Metric Learning',
Expand Down

0 comments on commit 96a8abc

Please sign in to comment.