PROFESSIONAL-MACHINE-LEARNING-ENGINEER · Question #187
You work for a food product company. Your company's historical sales data is stored in BigQuery.You need to use Vertex AI's custom training service to train multiple TensorFlow models that read the da
The correct answer is B. Write SQL queries to transform the data in-place in BigQuery.. To preprocess BigQuery data with min-max scaling and bucketing for TensorFlow training with minimal time, cost, and effort, perform these transformations directly within BigQuery using SQL queries.
Question
Options
- AWrite the transformations into Spark that uses the spark-bigquery-connector, and use Dataproc to
- BWrite SQL queries to transform the data in-place in BigQuery.
- CAdd the transformations as a preprocessing layer in the TensorFlow models.
- DCreate a Dataflow pipeline that uses the BigQuerylO connector to ingest the data, process it, and
How the community answered
(52 responses)- A13% (7)
- B77% (40)
- C4% (2)
- D6% (3)
Why each option
To preprocess BigQuery data with min-max scaling and bucketing for TensorFlow training with minimal time, cost, and effort, perform these transformations directly within BigQuery using SQL queries.
Using Spark on Dataproc for transformations introduces additional operational overhead, cluster management, and potentially higher cost and development effort compared to native BigQuery SQL for common transformations.
Performing min-max scaling and bucketing directly in BigQuery using SQL queries leverages its highly optimized, serverless processing capabilities. This minimizes preprocessing time and cost as data remains in-place, and for common transformations like these, SQL offers a low-effort development path compared to external processing frameworks.
Adding these transformations as preprocessing layers within each TensorFlow model would lead to redundant computation on the large dataset for every training run, significantly increasing training time and cost rather than minimizing preprocessing effort upfront.
Creating a Dataflow pipeline involves writing Beam code and managing a Dataflow job, which adds more development effort and complexity than simply using SQL queries within BigQuery for easily expressible transformations.
Concept tested: BigQuery data transformation, cost-effective data preprocessing
Source: https://cloud.google.com/bigquery/docs/best-practices-sql-queries
Topics
Community Discussion
No community discussion yet for this question.