The ML.FEATURE_INFO function
This document describes the ML.FEATURE_INFO
function, which lets you see
information about the input features that are used to train a model.
Syntax
ML.FEATURE_INFO(MODEL `project_id.dataset.model`)
Arguments
ML.FEATURE_INFO
takes the following arguments:
project_id
: Your project ID.dataset
: The BigQuery dataset that contains the model.model
: The name of the model.
Output
ML.FEATURE_INFO
returns the following columns:
input
: aSTRING
value that contains the name of the column in the input training data.min
: aFLOAT64
value that contains the minimum value in theinput
column.min
isNULL
for non-numeric inputs.max
: aFLOAT64
value that contains the maximum value in theinput
column.max
isNULL
for non-numeric inputs.mean
: aFLOAT64
value that contains the average value for theinput
column.mean
isNULL
for non-numeric inputs.median
: aFLOAT64
value that contains the median value for theinput
column.median
isNULL
for non-numeric inputs.stddev
: aFLOAT64
value that contains the standard deviation value for theinput
column.stddev
isNULL
for non-numeric inputs.category_count
: anINT64
value that contains the number of categories in theinput
column.category_count
isNULL
for non-categorical columns.null_count
: anINT64
value that contains the number ofNULL
values in theinput
column.dimension
: anINT64
value that contains the dimension of theinput
column if theinput
column has aARRAY<STRUCT>
type.dimension
isNULL
for non-ARRAY<STRUCT>
columns.
For matrix factorization
models, only category_count
is calculated for the user
and item
columns.
If you used the
TRANSFORM
clause
in the CREATE MODEL
statement that created the model, ML.FEATURE_INFO
outputs the information of the pre-transform columns from the
query_statement
argument.
Permissions
You must have the bigquery.models.create
and bigquery.models.getData
Identity and Access Management (IAM) permissions
in order to run ML.FEATURE_INFO
.
Limitations
ML.FEATURE_INFO
doesn't support
imported TensorFlow models.
Example
The following example retrieves feature information from the model
mydataset.mymodel
in your default project:
SELECT * FROM ML.FEATURE_INFO(MODEL `mydataset.mymodel`)
What's next
- For information about feature preprocessing, see Feature preprocessing overview.
- For information about the supported SQL statements and functions for each model type, see End-to-end user journey for each model.