normalize_labels.hpp
Go to the documentation of this file.
1 
14 #ifndef MLPACK_CORE_DATA_NORMALIZE_LABELS_HPP
15 #define MLPACK_CORE_DATA_NORMALIZE_LABELS_HPP
16 
17 #include <mlpack/prereqs.hpp>
18 
19 namespace mlpack {
20 namespace data {
21 
32 template<typename eT, typename RowType>
33 void NormalizeLabels(const RowType& labelsIn,
34  arma::Row<size_t>& labels,
35  arma::Col<eT>& mapping);
36 
45 template<typename eT>
46 void RevertLabels(const arma::Row<size_t>& labels,
47  const arma::Col<eT>& mapping,
48  arma::Row<eT>& labelsOut);
49 
50 } // namespace data
51 } // namespace mlpack
52 
53 // Include implementation.
54 #include "normalize_labels_impl.hpp"
55 
56 #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.
constexpr auto data(Container const &container) noexcept -> decltype(container.data())
Definition: iterator.hpp:79
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...