Skip to content

Commit

Permalink
Added installation instructions to doc
Browse files Browse the repository at this point in the history
  • Loading branch information
jlsuarezdiaz committed Aug 8, 2018
1 parent 39b14e5 commit 02c2657
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dml/tune.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ def tune_knn(dml,X,y,n_neighbors,dml_params,tune_args,n_folds=5,n_reps=1,verbose
print("*** Tuning Case ",tune_case,"...")

# DML algorthm with each tune params
dml_alg = dml(**tuned_args,**dml_params)
dml_alg = dml(**tuned_args, **dml_params)
alg = Pipeline([("DML",dml_alg),("KNN",knn)])

results = cross_validate(alg,X,y,n_folds=n_folds,n_reps=n_reps,verbose=verbose,seed=seed)
Expand Down
16 changes: 15 additions & 1 deletion doc/sphinx/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,26 @@ Welcome to pyDML's documentation!
=================================



The need of a similarity measure is very common in many machine learning algorithms, such as nearest neighbors classification.
Usually, a standard distance, like the euclidean distance, is used to measure this similarity. The distance metric learning
paradigm tries to learn an optimal distance from the data. This package provides the classic algorithms of supervised distance
metric learning, together with some of the newest proposals.

How to learn a distance?
------------------------

There are two main ways to learn a distance in Distance Metric Learning:

* Learning a metric matrix M, that is, a positive semidefinite matrix. In this case, the distance is measured as

.. math::
d(x,y) = \sqrt{(x-y)^TM(x-y)}.
* Learning a linear map L. This map is also represented by a matrix, not necessarily definite or squared. Here, the distance between two elements is the euclidean distance after applying the transformation.

Every linear map defines a single metric (:math:`M = L^TL`), and two linear maps that define the same metric only differ in an isometry. So both approaches are equivalent.


.. toctree::
:maxdepth: 1
Expand Down
5 changes: 4 additions & 1 deletion doc/sphinx/source/installation.rst
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
Installation
============
============

* PyPI latest version: :code:`pip install pyDML`.
* From GitHub: clone or download this repository and run the command :code:`python setup.py install` on the root directory.

0 comments on commit 02c2657

Please sign in to comment.