class

Stochasta::PCA

Inherits Reference < Object

Constructors

new(n_components : Int32)
Source

Class methods

jacobi_eigenvalues(matrix : Array(Array(Float64)), max_iterations : Int32 = 1000, tolerance : Float64 = 1e-9) : Tuple(Array(Float64), Array(Array(Float64)))

Jacobi eigenvalue algorithm for symmetric matrix A Returns {eigenvalues, eigenvectors_matrix} where eigenvectors_matrix is matrix of columns

Source

Instance methods

components
Source
components=(components : Array(Array(Float64)))
Source
eigenvalues
Source
eigenvalues=(eigenvalues : Array(Float64))
Source
explained_variance_ratio
Source
explained_variance_ratio=(explained_variance_ratio : Array(Float64))
Source
fit(data : Array(Array(Float64))) : self

Fits the PCA model on a dataset

Source
fit_transform(data : Array(Array(Float64))) : Array(Array(Float64))

Fit and transform

Source
means
Source
means=(means : Array(Float64))
Source
n_components
Source
n_components=(n_components : Int32)
Source
transform(data : Array(Array(Float64))) : Array(Array(Float64))

Transform the dataset into the reduced dimensional space

Source