Class PCA

Object
org.apache.spark.mllib.feature.PCA

public class PCA extends Object
A feature transformer that projects vectors to a low-dimensional space using PCA.

param: k number of principal components

  • Constructor Details

    • PCA

      public PCA(int k)
  • Method Details

    • fit

      public PCAModel fit(RDD<Vector> sources)
      Computes a PCAModel that contains the principal components of the input vectors.

      Parameters:
      sources - source vectors
      Returns:
      (undocumented)
    • fit

      public PCAModel fit(JavaRDD<Vector> sources)
      Java-friendly version of fit().
      Parameters:
      sources - (undocumented)
      Returns:
      (undocumented)
    • k

      public int k()