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
- Alphabetic
- By Inheritance
- Pca
- Serializable
- Product
- Equals
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- 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
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- val SVD: DenseSVD
Breeze SVD object for the centred data matrix
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- val colNames: Seq[String]
- lazy val cumuvar: DenseVector[Double]
Cumulative variance of the principal components
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- 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.
- val mat: DenseMatrix[Double]
- val n: Int
Number of observations
- val names: List[String]
Column names (as a List)
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- val p: Int
Number of variables
- def plots: Figure
Diagnostic plots for the PCA
- def productElementNames: Iterator[String]
- Definition Classes
- Product
- lazy val propvar: DenseVector[Double]
Proportion of variance explained by each principal component
- lazy val scores: DenseMatrix[Double]
n x p matrix of scores - the rotated data
- val sdev: DenseVector[Double]
Standard deviations of the principal components
- def summary: Unit
Prints a summary of the PCA to console
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- lazy val totVar: Double
The total variance of the principal components
- lazy val variance: DenseVector[Double]
Variances of the principal components
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- val x: DenseMatrix[Double]
Centred data matrix
- val xBar: DenseVector[Double]
Column means (for centring)