class PrincipalComponents extends Reducer with Error
The PrincipalComponents
class performs the Principal Component Analysis 'PCA'
on data matrix 'x'. It can be used to reduce the dimensionality of the data.
First find the Principal Components 'PC's by calling 'findPCs' and then call
'reduce' to reduce the data (i.e., reduce matrix 'x' to a lower dimensionality
matrix).
- Alphabetic
- By Inheritance
- PrincipalComponents
- Error
- Reducer
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
-
new
PrincipalComponents(x: MatrixD)
- x
the data matrix to reduce, stored column-wise
Value Members
-
def
findPCs(k: Int): MatrixD
Find the Principal Components/Features, the eigenvectors with the 'k' highest eigenvalues.
Find the Principal Components/Features, the eigenvectors with the 'k' highest eigenvalues.
- k
the number of Principal Components 'PC's to find
-
final
def
flaw(method: String, message: String): Unit
- Definition Classes
- Error
-
def
recover(): MatrixD
Approximately recover the original data by multiplying the reduced matrix by the inverse (via transpose) of the feature matrix and then adding back the means.
Approximately recover the original data by multiplying the reduced matrix by the inverse (via transpose) of the feature matrix and then adding back the means.
- Definition Classes
- PrincipalComponents → Reducer
-
def
reduce(): MatrixD
Multiply the zero mean data matrix by the feature matrix to reduce dimensionality.
Multiply the zero mean data matrix by the feature matrix to reduce dimensionality.
- Definition Classes
- PrincipalComponents → Reducer