[mlpack-git] [mlpack/mlpack] DatasetMapper & Imputer (#694)

Ryan Curtin notifications at github.com
Thu Jul 7 10:25:45 EDT 2016


> +              const std::string& missingValue,
> +              const size_t dimension)
> +  {
> +    T mappedValue = static_cast<T>(mapper.UnmapValue(missingValue, dimension));
> +    strategy.Impute(input, output, mappedValue, dimension, transpose);
> +  }
> +
> +  /**
> +  * This overload of Impute() lets users to define custom value that can be
> +  * replaced with the target value.
> +  */
> +  void Impute(const arma::Mat<T>& input,
> +              arma::Mat<T>& output,
> +              const std::string& missingValue,
> +              const T& customValue,
> +              const size_t dimension)

This overload seems like it is necessary specifically for the `CustomImputation` strategy, and allows the user to pass the `customValue` parameter.  But it seems like a user could accomplish the same thing by passing an instantiated `CustomImputation` to the constructor, if `CustomImputation` held as a local variable the `customValue`.  I think that would allow you to remove this function and simplify the code; what do you think?

Certainly in the examples for the imputer, we should document how someone can use the `CustomImputation` class as an example, since it would be a little more complex than just calling this function.

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/mlpack/mlpack/pull/694/files/a8818316a04506530e2269a2e0a32ba2f6a1c83b#r69916122
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160707/3e379fe6/attachment-0001.html>


More information about the mlpack-git mailing list