hyperspy_ml_algorithms.Orthomax#
- class hyperspy_ml_algorithms.Orthomax(gamma=1.0, tol=0.001, max_iter=100)#
Bases:
objectOrthomax rotation of components (varimax when gamma=1.0).
Computes an orthogonal rotation of the component matrix, preserving orthogonality of the components. When
gamma=1.0this is the standard varimax rotation, which finds a rotation matrix W that maximises the variance of the squared components.- Parameters:
- gammafloat, default=1.0
Orthomax parameter. If
gammain range[0, 1], use the SVD-based fast algorithm, otherwise solve with a sequence of bivariate rotations. The default (1.0) corresponds to varimax.- tolfloat, default=1e-3
Tolerance of the stopping condition.
- max_iterint, default=100
Maximum number of iterations before exiting without convergence.
- Attributes:
- rotation_matrix_ndarray of shape (n_components, n_components)
The learned rotation matrix.
- components_ndarray of shape (n_features, n_components)
The rotated components matrix (input
Xmultiplied byrotation_matrix_).
Notes
Orthomax operates on a component matrix, not raw data. The input
Xmust have shape(n_features, n_components); pass the transpose of components produced by sklearn-style decompositions, e.g.Orthomax().fit(pca.components_.T).Adapted from metpy.
- __init__(gamma=1.0, tol=0.001, max_iter=100)#
Methods
__init__([gamma, tol, max_iter])fit(X[, y])Fit the orthomax rotation to the component matrix X.
fit_transform(X[, y])Fit the orthomax rotation to X and return the rotated components.
transform(X)Apply the learned rotation to a component matrix X.