12 #ifndef MLPACK_CORE_DATA_IMPUTE_STRATEGIES_CUSTOM_IMPUTATION_HPP 13 #define MLPACK_CORE_DATA_IMPUTE_STRATEGIES_CUSTOM_IMPUTATION_HPP 28 customValue(
std::move(customValue))
46 const size_t dimension,
47 const bool columnMajor =
true)
52 for (
size_t i = 0; i < input.n_cols; ++i)
54 if (input(dimension, i) == mappedValue ||
55 std::isnan(input(dimension, i)))
57 input(dimension, i) = customValue;
63 for (
size_t i = 0; i < input.n_rows; ++i)
65 if (input(i, dimension) == mappedValue ||
66 std::isnan(input(i, dimension)))
68 input(i, dimension) = customValue;
A simple custom imputation class.
Linear algebra utility functions, generally performed on matrices or vectors.
The core includes that mlpack expects; standard C++ includes and Armadillo.
void Impute(arma::Mat< T > &input, const T &mappedValue, const size_t dimension, const bool columnMajor=true)
Impute function searches through the input looking for mappedValue and replaces it with the user-defi...
CustomImputation(T customValue)