The ML.PRINCIPAL_COMPONENT_INFO function
This document describes the
ML.PRINCIPAL_COMPONENT_INFO function, which lets
you see the statistics of the principal components in a principal component
analysis (PCA) model, such as
and explained variance ratio.
ML.PRINCIPAL_COMPONENT_INFO takes the following arguments:
STRINGvalue that specifies your project ID.
STRINGvalue that specifies the BigQuery dataset that contains the model.
STRINGvalue that specifies the name of the model.
ML.PRINCIPAL_COMPONENT_INFO returns the following columns:
INT64that contains the principal component. The table is ordered in descending order of the
FLOAT64value that contains the factor by which the eigenvector is scaled. Eigenvalue and explained variance are the same concepts in PCA.
FLOAT64value that contains the explained variance ratio, which is the ratio between the variance, also known as eigenvalue, of that principal component and the total variance. The total variance is the sum of the variances of all of the individual principal components.
FLOAT64value that contains the cumulative explained variance ratio of the k-th principal component, which is the sum of the explained variance ratios of all the previous principal components, including the k-th principal component.
The following example retrieves the eigenvalue-related information of each
principal component in the model
mydataset.mymodel in your default project.
SELECT * FROM ML.PRINCIPAL_COMPONENT_INFO(MODEL `mydataset.mymodel`)
- For information about model weights support in BigQuery ML, see BigQuery ML model weights overview.
- For information about the supported SQL statements and functions for each model type, see End-to-end user journey for each model.