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

Tham notifications at github.com
Fri Jul 22 14:06:18 EDT 2016


> +  }
> +
> +  /**
> +   * Impute function searches through the input looking for mappedValue and
> +   * remove the whole row or column. The result is overwritten to the input.
> +   *
> +   * @param input Matrix that contains mappedValue.
> +   * @param mappedValue Value that the user wants to get rid of.
> +   * @param dimension Index of the dimension of the mappedValue.
> +   * @param columnMajor State of whether the input matrix is columnMajor or not.
> +   */
> +  void Impute(arma::Mat<T>& input,
> +              const T& mappedValue,
> +              const size_t dimension,
> +              const bool columnMajor = true)
> +  {

Now I see what do you mean, yah, it do have lot of redundancy codes. We should be able to get rid of them by using the single input api 

```
inline
void Impute(const arma::Mat<T>& input,
                    arma::Mat<T>& output,
              const T& mappedValue,
              const size_t dimension,
              const bool columnMajor = true)
  {
     // initiate output
     output.set_size(input.n_rows, input.n_cols);
     Impute(output, mappedValue, dimension, columnMajor);
}


```

Last time it was implemented as

```
inline
void Impute(const arma::Mat<T>& input,
                    arma::Mat<T>& output,
              const T& mappedValue,
              const size_t dimension,
              const bool columnMajor = true)
  {
     // initiate output
     output = input;
     Impute(output, mappedValue, dimension, columnMajor);
}

```

Haven't noticed the new change generate duplicate codes, my fault

---
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/028c217057410e2e75691c32bf062202ce5dca3f#r71920523
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160722/4474c61e/attachment-0001.html>


More information about the mlpack-git mailing list