12 #ifndef MLPACK_METHODS_NCA_NCA_HPP
13 #define MLPACK_METHODS_NCA_NCA_HPP
65 NCA(
const arma::mat& dataset,
66 const arma::Row<size_t>& labels,
67 MetricType metric = MetricType());
81 const arma::mat&
Dataset()
const {
return dataset; }
83 const arma::Row<size_t>&
Labels()
const {
return labels; }
86 const OptimizerType<SoftmaxErrorFunction<MetricType> >&
Optimizer()
const
88 OptimizerType<SoftmaxErrorFunction<MetricType> >&
Optimizer()
93 const arma::mat& dataset;
95 const arma::Row<size_t>& labels;
104 OptimizerType<SoftmaxErrorFunction<MetricType> > optimizer;
111 #include "nca_impl.hpp"
The "softmax" stochastic neighbor assignment probability function.
NCA(const arma::mat &dataset, const arma::Row< size_t > &labels, MetricType metric=MetricType())
Construct the Neighborhood Components Analysis object.
const OptimizerType< SoftmaxErrorFunction< MetricType > > & Optimizer() const
Get the optimizer.
The core includes that mlpack expects; standard C++ includes and Armadillo.
OptimizerType< SoftmaxErrorFunction< MetricType > > & Optimizer()
const arma::mat & Dataset() const
Get the dataset reference.
Stochastic Gradient Descent is a technique for minimizing a function which can be expressed as a sum ...
LMetric< 2, false > SquaredEuclideanDistance
The squared Euclidean (L2) distance.
An implementation of Neighborhood Components Analysis, both a linear dimensionality reduction techniq...
const arma::Row< size_t > & Labels() const
Get the labels reference.
void LearnDistance(arma::mat &outputMatrix)
Perform Neighborhood Components Analysis.