MissingPolicy is used as a helper class for DatasetMapper. More...
Public Types | |
using | MappedType = double |
Public Member Functions | |
MissingPolicy () | |
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. More... | |
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 Public Attributes | |
static const bool | NeedsFirstPass = false |
This doesn't need a first pass over the data to set up. More... | |
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.
Definition at line 31 of file missing_policy.hpp.
using MappedType = double |
Definition at line 35 of file missing_policy.hpp.
|
inline |
Definition at line 37 of file missing_policy.hpp.
|
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.
missingSet | Set of strings that should be mapped. |
Definition at line 49 of file missing_policy.hpp.
|
inline |
There is nothing for us to do here, but this is required by the MapPolicy type.
Definition at line 63 of file missing_policy.hpp.
|
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.
MapType | Type of unordered_map that contains mapped value pairs |
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. |
Definition at line 84 of file missing_policy.hpp.
|
static |
This doesn't need a first pass over the data to set up.
Definition at line 56 of file missing_policy.hpp.