Class/Object

scalaglm

Pca

Related Docs: object Pca | package scalaglm

Permalink

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, Serializable, Product, Equals, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Pca
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

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

    Permalink

    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

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. val SVD: DenseSVD

    Permalink

    Breeze SVD object for the centred data matrix

  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. val colNames: Seq[String]

    Permalink

    Sequence of column names of mat

  8. lazy val cumuvar: DenseVector[Double]

    Permalink

    Cumulative variance of the principal components

  9. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  10. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  11. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  12. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  13. val loadings: DenseMatrix[Double]

    Permalink

    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]

    Permalink

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

  15. val n: Int

    Permalink

    Number of observations

  16. val names: List[String]

    Permalink

    Column names (as a List)

  17. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  18. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  19. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  20. val p: Int

    Permalink

    Number of variables

  21. def plots: Figure

    Permalink

    Diagnostic plots for the PCA

  22. lazy val propvar: DenseVector[Double]

    Permalink

    Proportion of variance explained by each principal component

  23. lazy val scores: DenseMatrix[Double]

    Permalink

    n x p matrix of scores - the rotated data

  24. val sdev: DenseVector[Double]

    Permalink

    Standard deviations of the principal components

  25. def summary: Unit

    Permalink

    Prints a summary of the PCA to console

  26. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  27. lazy val totVar: Double

    Permalink

    The total variance of the principal components

  28. lazy val variance: DenseVector[Double]

    Permalink

    Variances of the principal components

  29. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  30. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  31. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  32. val x: DenseMatrix[Double]

    Permalink

    Centred data matrix

  33. val xBar: DenseVector[Double]

    Permalink

    Column means (for centring)

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped