one_hot_encoding.hpp
Go to the documentation of this file.
1 
13 #ifndef MLPACK_CORE_DATA_ONE_HOT_ENCODING_HPP
14 #define MLPACK_CORE_DATA_ONE_HOT_ENCODING_HPP
15 
16 #include <mlpack/prereqs.hpp>
17 #include <mlpack/core.hpp>
18 
19 namespace mlpack {
20 namespace data {
21 
32 template<typename RowType, typename MatType>
33 void OneHotEncoding(const RowType& labelsIn,
34  MatType& output);
35 
45 template<typename eT>
46 void OneHotEncoding(const arma::Mat<eT>& input,
47  const arma::Col<size_t>& indices,
48  arma::Mat<eT>& output);
49 
60 template<typename eT>
61 void OneHotEncoding(const arma::Mat<eT>& input,
62  arma::Mat<eT>& output,
63  const data::DatasetInfo& datasetInfo);
64 
65 } // namespace data
66 } // namespace mlpack
67 
68 // Include implementation.
69 #include "one_hot_encoding_impl.hpp"
70 
71 #endif
Linear algebra utility functions, generally performed on matrices or vectors.
The core includes that mlpack expects; standard C++ includes and Armadillo.
void OneHotEncoding(const RowType &labelsIn, MatType &output)
Given a set of labels of a particular datatype, convert them to binary vector.
DatasetMapper< data::IncrementPolicy > DatasetInfo
Include all of the base components required to write mlpack methods, and the main mlpack Doxygen docu...