13 #ifndef MLPACK_CORE_CV_METRICS_FACILITIES_HPP 14 #define MLPACK_CORE_CV_METRICS_FACILITIES_HPP 28 template<
typename DataType,
typename Metric>
32 DataType distances = DataType(data.n_cols, data.n_cols, arma::fill::none);
33 for (
size_t i = 0; i < data.n_cols; i++)
35 for (
size_t j = 0; j < i; j++)
37 distances(i, j) = metric.Evaluate(data.col(i), data.col(j));
38 distances(j, i) = distances(i, j);
41 distances.diag().zeros();
Linear algebra utility functions, generally performed on matrices or vectors.
Include all of the base components required to write mlpack methods, and the main mlpack Doxygen docu...
DataType PairwiseDistances(const DataType &data, const Metric &metric)
Pairwise distance of the given data.