mlpack  2.0.1
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, typename RowType>
35 void NormalizeLabels(const RowType& labelsIn,
36  arma::Row<size_t>& labels,
37  arma::Col<eT>& mapping);
38 
47 template<typename eT>
48 void RevertLabels(const arma::Row<size_t>& labels,
49  const arma::Col<eT>& mapping,
50  arma::Row<eT>& labelsOut);
51 
52 } // namespace data
53 } // namespace mlpack
54 
55 // Include implementation.
56 #include "normalize_labels_impl.hpp"
57 
58 #endif
void NormalizeLabels(const RowType &labelsIn, arma::Row< 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...
Linear algebra utility functions, generally performed on matrices or vectors.
The core includes that mlpack expects; standard C++ includes and Armadillo.
void RevertLabels(const arma::Row< size_t > &labels, const arma::Col< eT > &mapping, arma::Row< eT > &labelsOut)
Given a set of labels that have been mapped to the range [0, n), map them back to the original labels...