bigframes.bigquery.ml.create_model#
- bigframes.bigquery.ml.create_model(model_name: str, *, replace: bool = False, if_not_exists: bool = False, transform: list[str] | None = None, input_schema: Mapping[str, str] | None = None, output_schema: Mapping[str, str] | None = None, connection_name: str | None = None, options: Mapping[str, str | int | float | bool | list] | None = None, training_data: DataFrame | DataFrame | str | None = None, custom_holiday: DataFrame | DataFrame | str | None = None, session: Session | None = None) Series[source]#
Creates a BigQuery ML model.
See the BigQuery ML CREATE MODEL DDL syntax for additional reference.
- Parameters:
model_name (str) – The name of the model in BigQuery.
replace (bool, default False) – Whether to replace the model if it already exists.
if_not_exists (bool, default False) – Whether to ignore the error if the model already exists.
transform (list[str], optional) – A list of SQL transformations for the TRANSFORM clause, which specifies the preprocessing steps to apply to the input data.
input_schema (Mapping[str, str], optional) – The INPUT clause, which specifies the schema of the input data.
output_schema (Mapping[str, str], optional) – The OUTPUT clause, which specifies the schema of the output data.
connection_name (str, optional) – The connection to use for the model.
options (Mapping[str, Union[str, int, float, bool, list]], optional) – The OPTIONS clause, which specifies the model options.
training_data (Union[bigframes.pandas.DataFrame, str], optional) – The query or DataFrame to use for training the model.
custom_holiday (Union[bigframes.pandas.DataFrame, str], optional) – The query or DataFrame to use for custom holiday data.
session (bigframes.session.Session, optional) – The session to use. If not provided, the default session is used.
- Returns:
A Series with object dtype containing the model metadata. Reference the BigQuery Model REST API reference for available fields.
- Return type: