[mlpack-git] [mlpack/mlpack] DatasetMapper & Imputer (#694)
Tham
notifications at github.com
Thu Jul 7 10:58:17 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);
> + }
> + }
Iterate non contiguous memory frequently would slow down the speed. But in this case I think this is necessary, because this imputation is apply to a single row only
---
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#r69922415
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160707/9821b52d/attachment.html>
More information about the mlpack-git
mailing list