mlpack  1.0.12
normalize_labels.hpp
Go to the documentation of this file.
1 
16 #ifndef __MLPACK_CORE_DATA_NORMALIZE_LABELS_HPP
17 #define __MLPACK_CORE_DATA_NORMALIZE_LABELS_HPP
18 
19 #include <mlpack/prereqs.hpp>
20 
21 namespace mlpack {
22 namespace data {
23 
34 template<typename eT>
35 void NormalizeLabels(const arma::Col<eT>& labelsIn,
36  arma::Col<size_t>& labels,
37  arma::Col<eT>& mapping);
38 
47 template<typename eT>
48 void RevertLabels(const arma::Col<size_t>& labels,
49  const arma::Col<eT>& mapping,
50  arma::Col<eT>& labelsOut);
51 
52 }; // namespace data
53 }; // namespace mlpack
54 
55 // Include implementation.
56 #include "normalize_labels_impl.hpp"
57 
58 #endif
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: load.hpp:23
The core includes that mlpack expects; standard C++ includes and Armadillo.
void NormalizeLabels(const arma::Col< eT > &labelsIn, arma::Col< size_t > &labels, arma::Col< eT > &mapping)
Given a set of labels of a particular datatype, convert them to unsigned labels in the range [0...
void RevertLabels(const arma::Col< size_t > &labels, const arma::Col< eT > &mapping, arma::Col< eT > &labelsOut)
Given a set of labels that have been mapped to the range [0, n), map them back to the original labels...