Distance Metric Learning Algorithms for R. This library is a R wrapper for the Python pyDML package.
Many machine learning algorithms need a similarity measure to carry out their tasks. Usually, standard distances, like euclidean distance, are used to measure this similarity. Distance Metric Learning algorithms try to learn an optimal distance from the data.
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
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 (M = L’L), and two linear maps that define the same metric only differ in an isometry. So both approaches are equivalent.
Watch the package documentation here. For more details about the wrapped algorithms, see also the pyDML’s documentation.
devtools
. Then, run the command devtools::install_github("jlsuarezdiaz/rDML")
.