Auxiliary information for a dataset, including mappings to/from strings and the datatype of each dimension.
More...
|
| DatasetInfo (const size_t dimensionality=0) |
| Create the DatasetInfo object with the given dimensionality. More...
|
|
size_t | Dimensionality () const |
|
size_t | MapString (const std::string &string, const size_t dimension) |
| Given the string and the dimension to which it belongs, return its numeric mapping. More...
|
|
size_t | NumMappings (const size_t dimension) const |
|
template<typename Archive > |
void | Serialize (Archive &ar, const unsigned int) |
|
Datatype | Type (const size_t dimension) const |
|
Datatype & | Type (const size_t dimension) |
|
const std::string & | UnmapString (const size_t value, const size_t dimension) |
|
|
std::unordered_map< size_t, std::pair< boost::bimap< std::string, size_t >, size_t > > | maps |
|
std::vector< Datatype > | types |
|
Auxiliary information for a dataset, including mappings to/from strings and the datatype of each dimension.
DatasetInfo objects are optionally produced by data::Load(), and store the type of each dimension (Datatype::NUMERIC or Datatype::CATEGORICAL) as well as mappings from strings to unsigned integers and vice versa.
Definition at line 45 of file dataset_info.hpp.
mlpack::data::DatasetInfo::DatasetInfo |
( |
const size_t |
dimensionality = 0 | ) |
|
Create the DatasetInfo object with the given dimensionality.
Note that the dimensionality cannot be changed later; you will have to create a new DatasetInfo object.
size_t mlpack::data::DatasetInfo::Dimensionality |
( |
| ) |
const |
size_t mlpack::data::DatasetInfo::MapString |
( |
const std::string & |
string, |
|
|
const size_t |
dimension |
|
) |
| |
Given the string and the dimension to which it belongs, return its numeric mapping.
If no mapping yet exists, the string is added to the list of mappings for the given dimension. The dimension parameter refers to the index of the dimension of the string (i.e. the row in the dataset).
- Parameters
-
string | String to find/create mapping for. |
dimension | Index of the dimension of the string. |
size_t mlpack::data::DatasetInfo::NumMappings |
( |
const size_t |
dimension | ) |
const |
template<typename Archive >
void mlpack::data::DatasetInfo::Serialize |
( |
Archive & |
ar, |
|
|
const unsigned |
int |
|
) |
| |
|
inline |
Datatype mlpack::data::DatasetInfo::Type |
( |
const size_t |
dimension | ) |
const |
Datatype& mlpack::data::DatasetInfo::Type |
( |
const size_t |
dimension | ) |
|
const std::string& mlpack::data::DatasetInfo::UnmapString |
( |
const size_t |
value, |
|
|
const size_t |
dimension |
|
) |
| |
std::unordered_map<size_t, std::pair<boost::bimap<std::string, size_t>, size_t> > mlpack::data::DatasetInfo::maps |
|
private |
std::vector<Datatype> mlpack::data::DatasetInfo::types |
|
private |
The documentation for this class was generated from the following file: