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

Keon Kim notifications at github.com
Wed Jul 13 02:40:22 EDT 2016


> +              const bool transpose = true)
> +  {
> +    //initiate output
> +    output = input;
> +
> +    if (transpose)
> +    {
> +      arma::Mat<T> medianMat = arma::median(input, 1);
> +      for (size_t i = 0; i < input.n_cols; ++i)
> +      {
> +        if (input(dimension, i) == mappedValue ||
> +            std::isnan(input(dimension, i)))
> +        {
> +          output(dimension, i) = medianMat(dimension, 0);
> +        }
> +      }

Hmm... so should I make an overload that replaces the whole matrix?

>It would also be slower in this case because we would be calculating the mean for every dimension every time we called the method.
I believe this problem can be solved in the following pull request. I am building a Statistics class that calculates mean, median, std, skew, kurtosis.. etc only on a give dimension. 

But I guess it will still not be the optimal solution, since it'll still going through each column.

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


More information about the mlpack-git mailing list