[mlpack-git] [mlpack/mlpack] DatasetMapper & Imputer (#694)
Tham
notifications at github.com
Thu Jul 21 10:54:43 EDT 2016
I give set_size solution a try, it work.
```
void Impute(const arma::Mat<T>& input,
arma::Mat<T>& output,
const T& mappedValue,
const size_t dimension,
const bool columnMajor = true)
{
output.set_size(input.n_rows, input.n_cols);
Impute(output, mappedValue, dimension, columnMajor);
}
```
Impute like this
```
CustomImputation<double> customStrategy(99); // convert missing vals to 99.
Imputer<double,
DatasetMapper<MissingPolicy>,
CustomImputation<double>> imputer(info, customStrategy);
output = input;
imputer.Impute(input, output, "a", 0); // convert a -> 99 for dimension 0
```
This should avoid the redundant copy. Maybe we could remove the api with output? Keep the api with one input? I could handle this part after merged.
---
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#issuecomment-234279295
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160721/21c9f253/attachment.html>
More information about the mlpack-git
mailing list