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
>
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...

 

Detailed Description

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.

Member Typedef Documentation

◆ MappedType

using MappedType = double

Definition at line 35 of file missing_policy.hpp.

Constructor & Destructor Documentation

◆ MissingPolicy() [1/2]

MissingPolicy ( )
inline

Definition at line 37 of file missing_policy.hpp.

◆ MissingPolicy() [2/2]

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
missingSetSet of strings that should be mapped.

Definition at line 49 of file missing_policy.hpp.

Member Function Documentation

◆ MapFirstPass()

void MapFirstPass ( const std::string &  ,
const size_t   
)
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.

◆ MapString()

T 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
MapTypeType of unordered_map that contains mapped value pairs
Parameters
stringString to find/create mapping for.
dimensionIndex of the dimension of the string.
mapsUnordered map given by the DatasetMapper.
*(types) Vector containing the type information about each dimensions.

Definition at line 84 of file missing_policy.hpp.

Member Data Documentation

◆ NeedsFirstPass

const bool NeedsFirstPass = false
static

This doesn't need a first pass over the data to set up.

Definition at line 56 of file missing_policy.hpp.


The documentation for this class was generated from the following file:
  • /home/ryan/src/mlpack.org/_src/mlpack-git/src/mlpack/core/data/map_policies/missing_policy.hpp