MLPACK  1.0.7
normalize_labels.hpp
Go to the documentation of this file.
1 
24 #ifndef __MLPACK_CORE_DATA_NORMALIZE_LABELS_HPP
25 #define __MLPACK_CORE_DATA_NORMALIZE_LABELS_HPP
26 
27 #include <mlpack/core.hpp>
28 
29 namespace mlpack {
30 namespace data {
31 
42 template<typename eT>
43 void NormalizeLabels(const arma::Col<eT>& labelsIn,
44  arma::Col<size_t>& labels,
45  arma::Col<eT>& mapping);
46 
55 template<typename eT>
56 void RevertLabels(const arma::Col<size_t>& labels,
57  const arma::Col<eT>& mapping,
58  arma::Col<eT>& labelsOut);
59 
60 }; // namespace data
61 }; // namespace mlpack
62 
63 // Include implementation.
64 #include "normalize_labels_impl.hpp"
65 
66 #endif
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...