13 #ifndef MLPACK_CORE_DATA_IMPUTER_HPP
14 #define MLPACK_CORE_DATA_IMPUTER_HPP
32 template<
typename T,
typename MapperType,
typename StrategyType>
36 Imputer(MapperType mapper,
bool columnMajor =
true):
37 mapper(
std::move(mapper)),
38 columnMajor(columnMajor)
43 Imputer(MapperType mapper, StrategyType strategy,
bool columnMajor =
true):
44 strategy(
std::move(strategy)),
45 mapper(
std::move(mapper)),
46 columnMajor(columnMajor)
61 const std::string& missingValue,
62 const size_t dimension)
64 T mappedValue =
static_cast<T
>(mapper.UnmapValue(missingValue, dimension));
65 strategy.Impute(input, mappedValue, dimension, columnMajor);
69 const StrategyType&
Strategy()
const {
return strategy; }
75 const MapperType&
Mapper()
const {
return mapper; }
78 MapperType&
Mapper() {
return mapper; }
82 StrategyType strategy;