Google Cloud Blog
Follow
Zero-shot predictions in Pandas using the new BigQuery Accessor
BigQuery DataFrames (BigFrames) introduces a new .bigquery accessor, allowing users to run advanced machine learning directly within familiar pandas DataFrames. This integration enables seamless invocation of BigQuery's enterprise-grade AI functions on cloud infrastructure. For tasks like linear regression, users can now leverage ai.predict() directly on BigQuery data, bypassing local training. The .bigquery accessor translates pandas operations into Google Standard SQL, executing models natively on BigQuery. Environment setup requires specific Google Cloud roles and installation of pandas and bigframes. AI functions are available for both pandas Series and DataFrames. For Series, ai.embed() computes text embeddings and ai.similarity() calculates cosine similarity scores. DataFrame functions handle multi-column operations, such as ai.forecast() for time-series forecasting and ai.if_() for natural-language row filtering. These functions abstract away the complexity of cloud infrastructure and model execution. The goal is to empower data scientists to perform sophisticated AI tasks without leaving the Python ecosystem. Supported functions include embedding generation, classification, forecasting, and predictive modeling. BigQuery AI functions within pandas simplify scaling machine learning workflows.