12 #ifndef MLPACK_METHODS_NCA_NCA_HPP 13 #define MLPACK_METHODS_NCA_NCA_HPP 17 #include <ensmallen.hpp> 48 typename OptimizerType = ens::StandardSGD>
61 NCA(
const arma::mat& dataset,
62 const arma::Row<size_t>& labels,
63 MetricType metric = MetricType());
77 template<
typename... CallbackTypes>
78 void LearnDistance(arma::mat& outputMatrix, CallbackTypes&&... callbacks);
81 const arma::mat&
Dataset()
const {
return dataset; }
83 const arma::Row<size_t>&
Labels()
const {
return labels; }
86 const OptimizerType&
Optimizer()
const {
return optimizer; }
87 OptimizerType&
Optimizer() {
return optimizer; }
91 const arma::mat& dataset;
93 const arma::Row<size_t>& labels;
102 OptimizerType optimizer;
The "softmax" stochastic neighbor assignment probability function.
Definition: nca_softmax_error_function.hpp:45
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: cv.hpp:1
The core includes that mlpack expects; standard C++ includes and Armadillo.
void LearnDistance(arma::mat &outputMatrix, CallbackTypes &&... callbacks)
Perform Neighborhood Components Analysis.
Definition: nca_impl.hpp:34
const OptimizerType & Optimizer() const
Get the optimizer.
Definition: nca.hpp:86
NCA(const arma::mat &dataset, const arma::Row< size_t > &labels, MetricType metric=MetricType())
Construct the Neighborhood Components Analysis object.
Definition: nca_impl.hpp:23
The L_p metric for arbitrary integer p, with an option to take the root.
Definition: lmetric.hpp:63
const arma::mat & Dataset() const
Get the dataset reference.
Definition: nca.hpp:81
An implementation of Neighborhood Components Analysis, both a linear dimensionality reduction techniq...
Definition: nca.hpp:49
const arma::Row< size_t > & Labels() const
Get the labels reference.
Definition: nca.hpp:83