[mlpack-git] [mlpack/mlpack] Refactor PCA class: able to use different decomposition techniques (exact, randomized, QUIC SVD). (#716)

Tham notifications at github.com
Tue Jul 5 09:24:19 EDT 2016


> +  QUICSVDPolicy(const double epsilon = 0.03, const double delta = 0.1) :
> +       epsilon(epsilon),
> +       delta(delta)
> +  {
> +    /* Nothing to do here */
> +  }
> +
> +  /**
> +   * Apply Principal Component Analysis to the provided data set using the
> +   * QUIC-SVD method.
> +   *
> +   * @param data Data matrix.
> +   * @param data Centered data matrix.
> +   * @param transformedData Matrix to put results of PCA into.
> +   * @param eigVal Vector to put eigenvalues into.
> +   * @param eigvec Matrix to put eigenvectors (loadings) into.

The parameter name are different, one called eigvec, and another called coeff.
Besides, The Apply function of PCA, the comments are written for the same functions and different with each other.

pca.hpp

```
 /**
   * Apply Principal Component Analysis to the provided data set.  It is safe to
   * pass the same matrix reference for both data and transformedData.
   *
   * @param data Data matrix.
   * @param transformedData Matrix to put results of PCA into.
   * @param eigval Vector to put eigenvalues into.
   * @param eigvec Matrix to put eigenvectors (loadings) into.
   */
  void Apply(const arma::mat& data,
             arma::mat& transformedData,
             arma::vec& eigval,
arma::mat& eigvec);

```

pca_impl.hpp

```
/**
 * Apply Principal Component Analysis to the provided data set.
 *
 * @param data - Data matrix
 * @param transformedData - Data with PCA applied
 * @param eigVal - contains eigen values in a column vector
 * @param coeff - PCA Loadings/Coeffs/EigenVectors
 */
template<typename DecompositionPolicy>
void PCA<DecompositionPolicy>::Apply(const arma::mat& data,
                arma::mat& transformedData,
                arma::vec& eigVal,
arma::mat& coeff)
```

---
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/716/files/1d675d4febd84d3210a10c6cc18efa1bb1558045#r69561519
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160705/8563f426/attachment.html>


More information about the mlpack-git mailing list