Loading...

vastorbit.machine_learning.memmodel.decomposition.PCA.rotate

PCA.rotate(gamma: float = 1.0, q: int = 20, tol: float = 1e-06) None

Performs an Oblimin (Varimax, Quartimax) rotation on the PCA matrix.

Parameters:
  • gamma (float, optional) –

    Oblimin rotation factor, determines the type of rotation. It must be between 0.0 and 1.0.

    • gamma = 0.0 results in

      a Quartimax rotation.

    • gamma = 1.0 results in

      a Varimax rotation.

  • q (int, optional) – Maximum number of iterations.

  • tol (float, optional) – The algorithm stops when the Frobenius norm of gradient is less than tol.

Examples

Import the required module.

from vastorbit.machine_learning.memmodel.decomposition import PCA

We will use the following attributes:

principal_components = [
    [0.4, 0.5],
    [0.3, 0.2],
]
mean = [0.1, 0.3]

Let’s create a model.

model_pca = PCA(principal_components, mean)

Create a dataset.

data = [[4, 5]]

Let’s use the following column names:

cnames = ['col1', 'col2']

Rotate the matrix.

model_pca.rotate()

Note

Refer to PCA for more information about the different methods and usages.