The Kaiser criterion selects principal components whose eigenvalues exceed 1. An eigenvalue of 1 represents the information carried by one original variable, so larger values identify components worth retaining. section 3.5.2
Apply the criterion in a PCA workflow:
- Standardize the independent variables before calculating the covariance matrix. section 3.5.2
- Calculate covariance-matrix eigenvalues and arrange them in descending order. section 3.5.2
- Retain components with eigenvalues greater than 1, then inspect explained variance and a scree plot. section 3.5.2
Iris dimensionality reduction
For the standardized Iris variables, PCA showed that the first two components captured 72.77% and 23.03% of the variance, totaling 95.08%; the dataset was then represented with two components. section 3.5.2
eigen_values, eigen_vectors = np.linalg.eig(covariance_matrix)
eigen_pairs = [(np.abs(eigen_values[i]), eigen_vectors[:,i]) for i in range(len(eigen_values))]
print('Eigenvalues arranged in descending order:')
for i in eigen_pairs:
print(i[0])
Inspect the NumPy eigenvalue calculation and descending ordering used to apply the criterion. section 3.5.2
