Packages

case class Pca(mat: DenseMatrix[Double], colNames: Seq[String]) extends Product with Serializable

Principal components analysis

Computed using SVD of the centred data matrix rather than from the spectral decomposition of the covariance matrix. eg. More like the R function "prcomp" than the R function "princomp".

NOTE: .loadings are transposed relative to the PCA function in Breeze

mat

Data matrix with rows corresponding to observations and columns corresponding to variables

colNames

Sequence of column names of mat

returns

An object of type Pca with methods such as .loadings, .scores, .sdev and .summary

Linear Supertypes
Serializable, Product, Equals, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Pca
  2. Serializable
  3. Product
  4. Equals
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new Pca(mat: DenseMatrix[Double], colNames: Seq[String])

    mat

    Data matrix with rows corresponding to observations and columns corresponding to variables

    colNames

    Sequence of column names of mat

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. val SVD: DenseSVD

    Breeze SVD object for the centred data matrix

  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  7. val colNames: Seq[String]
  8. lazy val cumuvar: DenseVector[Double]

    Cumulative variance of the principal components

  9. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  10. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  11. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  12. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  13. val loadings: DenseMatrix[Double]

    Loadings/rotation matrix.

    Loadings/rotation matrix. Note that this is the TRANSPOSE of the corresponding Breeze method. But this is the usual way the rotations are reported. See how the .summary method labels the rows and columns if you are confused.

  14. val mat: DenseMatrix[Double]
  15. val n: Int

    Number of observations

  16. val names: List[String]

    Column names (as a List)

  17. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  18. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  19. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  20. val p: Int

    Number of variables

  21. def plots: Figure

    Diagnostic plots for the PCA

  22. def productElementNames: Iterator[String]
    Definition Classes
    Product
  23. lazy val propvar: DenseVector[Double]

    Proportion of variance explained by each principal component

  24. lazy val scores: DenseMatrix[Double]

    n x p matrix of scores - the rotated data

  25. val sdev: DenseVector[Double]

    Standard deviations of the principal components

  26. def summary: Unit

    Prints a summary of the PCA to console

  27. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  28. lazy val totVar: Double

    The total variance of the principal components

  29. lazy val variance: DenseVector[Double]

    Variances of the principal components

  30. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  31. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  32. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  33. val x: DenseMatrix[Double]

    Centred data matrix

  34. val xBar: DenseVector[Double]

    Column means (for centring)

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped