DATASET: The BigQuery dataset
that contains the model.
MODEL_NAME: The name of the model.
Output
ML.FEATURE_INFO returns the following columns:
input: a STRING value that contains the name of the column in the
input training data.
min: a FLOAT64 value that contains the minimum value in the input
column. min is NULL for non-numeric inputs.
max: a FLOAT64 value that contains the maximum value in the input
column. max is NULL for non-numeric inputs.
mean: a FLOAT64 value that contains the average value for the input
column. mean is NULL for non-numeric inputs.
median: a FLOAT64 value that contains the median value for the input
column. median is NULL for non-numeric inputs.
stddev: a FLOAT64 value that contains the standard deviation value for
the input column. stddev is NULL for non-numeric inputs.
category_count: an INT64 value that contains the number of categories
in the input column. category_count is NULL for non-categorical columns.
null_count: an INT64 value that contains the number of NULL values
in the input column.
dimension: an INT64 value that contains the dimension of the input
column if the input column has a ARRAY<STRUCT> type. dimension is
NULL 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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-25 UTC."],[[["\u003cp\u003e\u003ccode\u003eML.FEATURE_INFO\u003c/code\u003e is a function that provides details about the input features used to train a model.\u003c/p\u003e\n"],["\u003cp\u003eThe function syntax is \u003ccode\u003eML.FEATURE_INFO(MODEL project_id.dataset.model)\u003c/code\u003e, requiring the project ID, dataset, and model name as arguments.\u003c/p\u003e\n"],["\u003cp\u003eThe output includes columns such as \u003ccode\u003einput\u003c/code\u003e, \u003ccode\u003emin\u003c/code\u003e, \u003ccode\u003emax\u003c/code\u003e, \u003ccode\u003emean\u003c/code\u003e, \u003ccode\u003emedian\u003c/code\u003e, \u003ccode\u003estddev\u003c/code\u003e, \u003ccode\u003ecategory_count\u003c/code\u003e, \u003ccode\u003enull_count\u003c/code\u003e, and \u003ccode\u003edimension\u003c/code\u003e, providing insights into the characteristics of each input feature.\u003c/p\u003e\n"],["\u003cp\u003eSpecific rules apply for \u003ccode\u003ematrix factorization\u003c/code\u003e models, they only calculate \u003ccode\u003ecategory_count\u003c/code\u003e for the \u003ccode\u003euser\u003c/code\u003e and \u003ccode\u003eitem\u003c/code\u003e columns, and the function also shows information on the pre-transform columns when the \u003ccode\u003eTRANSFORM\u003c/code\u003e clause is used.\u003c/p\u003e\n"],["\u003cp\u003eRunning \u003ccode\u003eML.FEATURE_INFO\u003c/code\u003e requires \u003ccode\u003ebigquery.models.create\u003c/code\u003e and \u003ccode\u003ebigquery.models.getData\u003c/code\u003e permissions, and it does not support imported TensorFlow models.\u003c/p\u003e\n"]]],[],null,["# The ML.FEATURE_INFO function\n============================\n\nThis document describes the `ML.FEATURE_INFO` function, which lets you see\ninformation about the input features that are used to train a model.\n\nSyntax\n------\n\n```sql\nML.FEATURE_INFO(MODEL `PROJECT_ID.DATASET.MODEL_NAME`)\n```\n\n### Arguments\n\n`ML.FEATURE_INFO` takes the following arguments:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: Your project ID.\n- \u003cvar translate=\"no\"\u003eDATASET\u003c/var\u003e: The BigQuery dataset that contains the model.\n- \u003cvar translate=\"no\"\u003eMODEL_NAME\u003c/var\u003e: The name of the model.\n\nOutput\n------\n\n`ML.FEATURE_INFO` returns the following columns:\n\n- `input`: a `STRING` value that contains the name of the column in the input training data.\n- `min`: a `FLOAT64` value that contains the minimum value in the `input` column. `min` is `NULL` for non-numeric inputs.\n- `max`: a `FLOAT64` value that contains the maximum value in the `input` column. `max` is `NULL` for non-numeric inputs.\n- `mean`: a `FLOAT64` value that contains the average value for the `input` column. `mean` is `NULL` for non-numeric inputs.\n- `median`: a `FLOAT64` value that contains the median value for the `input` column. `median` is `NULL` for non-numeric inputs.\n- `stddev`: a `FLOAT64` value that contains the standard deviation value for the `input` column. `stddev` is `NULL` for non-numeric inputs.\n- `category_count`: an `INT64` value that contains the number of categories in the `input` column. `category_count` is `NULL` for non-categorical columns.\n- `null_count`: an `INT64` value that contains the number of `NULL` values in the `input` column.\n- `dimension`: an `INT64` value that contains the dimension of the `input` column if the `input` column has a `ARRAY\u003cSTRUCT\u003e` type. `dimension` is `NULL` for non-`ARRAY\u003cSTRUCT\u003e` columns.\n\nFor [matrix factorization](/bigquery/docs/reference/standard-sql/bigqueryml-syntax-create-matrix-factorization)\nmodels, only `category_count` is calculated for the `user` and `item`\ncolumns.\n\nIf you used the\n[`TRANSFORM` clause](/bigquery/docs/reference/standard-sql/bigqueryml-syntax-create#transform)\nin the `CREATE MODEL` statement that created the model, `ML.FEATURE_INFO`\noutputs the information of the pre-transform columns from the\n`query_statement` argument.\n\nPermissions\n-----------\n\nYou must have the `bigquery.models.create` and `bigquery.models.getData`\n[Identity and Access Management (IAM) permissions](/bigquery/docs/access-control#bq-permissions)\nin order to run `ML.FEATURE_INFO`.\n\nLimitations\n-----------\n\n`ML.FEATURE_INFO` doesn't support\n[imported TensorFlow models](/bigquery/docs/reference/standard-sql/bigqueryml-syntax-create-tensorflow).\n\nExample\n-------\n\nThe following example retrieves feature information from the model\n`mydataset.mymodel` in your default project: \n\n```sql\nSELECT\n *\nFROM\n ML.FEATURE_INFO(MODEL `mydataset.mymodel`)\n```\n\nWhat's next\n-----------\n\n- For information about feature preprocessing, see [Feature preprocessing overview](/bigquery/docs/preprocess-overview).\n- For information about the supported SQL statements and functions for each model type, see [End-to-end user journey for each model](/bigquery/docs/e2e-journey)."]]