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

Keon Kim notifications at github.com
Sun Jul 10 19:07:11 EDT 2016


> +              const T& mappedValue,
> +              const size_t dimension,
> +              const bool transpose = true)
> +  {
> +    // initiate output
> +    output = input;
> +    size_t count = 0;
> +
> +    if (transpose)
> +    {
> +      for (size_t i = 0; i < input.n_cols; ++i)
> +      {
> +         if (input(dimension, i) == mappedValue ||
> +             std::isnan(input(dimension, i)))
> +         {
> +           output.shed_col(i - count);

I tested listwise_deletion to impute iris.csv with 100000 looping.
Original Way
[INFO ]   impute: 4.265383s
Cols() Way
[INFO ]   impute: 4.129703s
Turns out that using cols() is slightly faster.

---
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#r70190073
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160710/325e0d17/attachment-0001.html>


More information about the mlpack-git mailing list