bigframes.ml.remote.VertexAIModel#

class bigframes.ml.remote.VertexAIModel(endpoint: str, input: Mapping[str, str], output: Mapping[str, str], *, session: Session | None = None, connection_name: str | None = None)[source]#

Remote model from a Vertex AI HTTPS endpoint. User must specify HTTPS endpoint, input schema and output schema. For more information, see Deploy model on Vertex AI: https://cloud.google.com/bigquery/docs/bigquery-ml-remote-model-tutorial#Deploy-Model-on-Vertex-AI.

Parameters:
  • endpoint (str) – Vertex AI HTTPS endpoint.

  • input (Mapping) – Input schema: {column_name: column_type}. Supported types are “bool”, “string”, “int64”, “float64”, “array<bool>”, “array<string>”, “array<int64>”, “array<float64>”.

  • output (Mapping) – Output label schema: {column_name: column_type}. Supported the same types as the input.

  • session (bigframes.Session or None) – BQ session to create the model. If None, use the global default session.

  • connection_name (str or None) – Connection to connect with remote service. str of the format <PROJECT_NUMBER/PROJECT_ID>.<LOCATION>.<CONNECTION_ID>. If None, use default connection in session context. BigQuery DataFrame will try to create the connection and attach permission if the connection isn’t fully set up.

predict(X: DataFrame | Series | DataFrame | Series) DataFrame[source]#

Predict the result from the input DataFrame.

Parameters:

X (bigframes.pandas.DataFrame or bigframes.pandas.Series or pandas.DataFrame or pandas.Series) – Input DataFrame or Series, which needs to comply with the input parameter of the model.

Returns:

DataFrame of shape (n_samples, n_input_columns + n_prediction_columns). Returns predicted values.

Return type:

bigframes.pandas.DataFrame