An implementation of Large Margin nearest neighbor metric learning technique.
More...
|
| LMNN (const arma::mat &dataset, const arma::Row< size_t > &labels, const size_t k, const MetricType metric=MetricType()) |
| Initialize the LMNN object, passing a dataset (distance metric is learned using this dataset) and labels. More...
|
|
const arma::mat & | Dataset () const |
| Get the dataset reference. More...
|
|
const size_t & | K () const |
| Access the value of k. More...
|
|
size_t | K () |
| Modify the value of k. More...
|
|
const arma::Row< size_t > & | Labels () const |
| Get the labels reference. More...
|
|
template<typename... CallbackTypes> |
void | LearnDistance (arma::mat &outputMatrix, CallbackTypes &&... callbacks) |
| Perform Large Margin Nearest Neighbors metric learning. More...
|
|
const OptimizerType & | Optimizer () const |
| Get the optimizer. More...
|
|
OptimizerType & | Optimizer () |
|
const size_t & | Range () const |
| Access the range value. More...
|
|
size_t & | Range () |
| Modify the range value. More...
|
|
const double & | Regularization () const |
| Access the regularization value. More...
|
|
double & | Regularization () |
| Modify the regularization value. More...
|
|
template
<
typename
MetricType
=
metric::SquaredEuclideanDistance
,
class mlpack::lmnn::LMNN< MetricType, OptimizerType >
An implementation of Large Margin nearest neighbor metric learning technique.
The method seeks to improve clustering & classification algorithms on a dataset by transforming the dataset representation in a more convenient form for them. It introduces the concept of target neighbors and impostors, focusing on the idea that the distance between impostors and the perimeters established by target neighbors should be large and that between target neighbors and data point should be small. It requires the knowledge of target neighbors beforehand. Moreover, target neighbors once initialized remain same.
For more details, see the following published paper:
@ARTICLE{weinberger09distance,
author = {Weinberger,
K.Q. and Saul, L.K.},
title = {{Distance metric learning for large margin nearest neighbor
classification}},
journal = {The Journal of Machine Learning Research},
year = {2009},
volume = {10},
pages = {207--244},
publisher = {MIT Press}
}
- Template Parameters
-
MetricType | The type of metric to use for computation. |
OptimizerType | Optimizer to use for developing distance. |
Definition at line 55 of file lmnn.hpp.