MissingPolicy is used as a helper class for DatasetMapper.
More...
#include <missing_policy.hpp>
|
using | MappedType = double |
|
|
| MissingPolicy (std::set< std::string > missingSet) |
| Create the MissingPolicy object with the given missingSet. More...
|
|
template<typename T > |
void | MapFirstPass (const std::string &, const size_t) |
| There is nothing for us to do here, but this is required by the MapPolicy type.
|
|
template<typename MapType , typename T > |
T | MapString (const std::string &string, const size_t dimension, MapType &maps, std::vector< Datatype > &) |
| Given the string and the dimension to which it belongs by the user, and the maps and types given by the DatasetMapper class, returns its numeric mapping. More...
|
|
|
static const bool | NeedsFirstPass = false |
| This doesn't need a first pass over the data to set up.
|
|
MissingPolicy is used as a helper class for DatasetMapper.
It tells how the strings should be mapped. Purpose of this policy is to map all user-defined missing variables into maps so that users can decide what to do with the corrupted data. User-defined missing variables are given by the missingSet. Note that MissingPolicy does not change type of features.
◆ MissingPolicy()
mlpack::data::MissingPolicy::MissingPolicy |
( |
std::set< std::string > |
missingSet | ) |
|
|
inlineexplicit |
Create the MissingPolicy object with the given missingSet.
Note that the missingSet cannot be changed later; you will have to create a new MissingPolicy object.
- Parameters
-
missingSet | Set of strings that should be mapped. |
◆ MapString()
template<typename MapType , typename T >
T mlpack::data::MissingPolicy::MapString |
( |
const std::string & |
string, |
|
|
const size_t |
dimension, |
|
|
MapType & |
maps, |
|
|
std::vector< Datatype > & |
|
|
) |
| |
|
inline |
Given the string and the dimension to which it belongs by the user, and the maps and types given by the DatasetMapper class, returns its numeric mapping.
If no mapping yet exists and the string is included in the missingSet, the string is added to the list of mappings for the given dimension. This function is used as a helper function for DatasetMapper class.
- Template Parameters
-
MapType | Type of unordered_map that contains mapped value pairs |
- Parameters
-
string | String to find/create mapping for. |
dimension | Index of the dimension of the string. |
maps | Unordered map given by the DatasetMapper. |
* | (types) Vector containing the type information about each dimensions. |
The documentation for this class was generated from the following file: