Fork me on GitHub
Arraymancer Technical reference Tutorial Spellbook (How-To's) Under the hood

pca

Search:
Group by:

Procs

proc pca[T: SomeFloat](x: Tensor[T]; nb_components = 2): tuple[results: Tensor[T],
    components: Tensor[T]] {...}{.noInit.}
Principal Component Analysis (PCA)
Inputs:
  • A matrix of shape [Nb of observations, Nb of features]
  • The number of components to keep (default 2D for 2D projection)
Returns:
  • A tuple of results and components: results: a matrix of shape [Nb of observations, Nb of components] components: a matrix of shape [Nb of observations, Nb of components] in descending order
  Source Edit
proc pca[T: SomeFloat](x: Tensor[T]; principal_axes: Tensor[T]): Tensor[T] {...}{.noInit.}
Principal Component Analysis (PCA) projection
Inputs:
  • A matrix of shape [Nb of observations, Nb of components]
  • A matrix of shape [Nb of observations, Nb of components] to project on, in descending order
Returns:
  • A matrix of shape [Nb of observations, Nb of components]
  Source Edit