How to Minimize Preprocessing Cost and Effort for Vertex AI Training?

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 data from BigQuery and predict future sales. You plan to implement a data preprocessing algorithm that performs mm-max scaling and bucketing on a large number of features before you start experimenting with the models. You want to minimize preprocessing time, cost, and development effort. How should you configure this workflow?

  1. Write the transformations into Spark that uses the spark-bigquery-connector, and use Dataproc to preprocess the data.
  2. Write SQL queries to transform the data in-place in BigQuery. Source Reference Answer
  3. Add the transformations as a preprocessing layer in the TensorFlow models.
  4. Create a Dataflow pipeline that uses the BigQuerylO connector to ingest the data, process it, and write it back to BigQuery.

Community Votes

B
100%

100% of anonymous learners picked answer B. Votes are pick records left by other test-takers — they are not the verified answer.

Community Insight

This question tests your ability to select the most efficient data preprocessing strategy for Vertex AI training workflows, where the common trap is choosing TensorFlow layers to keep logic centralized instead of pushing transformations to the source data.

Optimizing feature preprocessing for machine learning pipelines by leveraging cloud-native data warehouse capabilities. The community strongly agrees that executing transformations directly in BigQuery via SQL reduces data movement, lowers costs, and accelerates development compared to external compute services or model-layer preprocessing.

Option C (TensorFlow preprocessing layers) is frequently chosen because candidates assume it simplifies development and avoids extra storage, but it forces redundant computation during every training epoch and increases cluster resource consumption.

Community Discussion (6 comments)

cert_pz 👍 1 Selected: C
Since it is already given that we will be using a TF-Model and do experiments exclusevly there, I don't see why we wouldn't use TF-Layers to preprocess the data. We would minimize costs by not having to store additional data. Time would be around the same as the layer transforms the attribute during training time and development would also be simpler, since if you are using keras it would literally be 2 more lines of code. However I see the Argument for B as well but I would still go with C in this case. Specifically in this case I would use Normalization layer for normalization and Discretization layer for binning/bucketing.
fitri001 👍 3 Selected: B
In-place Transformation: BigQuery allows you to perform data transformations directly within the data warehouse using SQL queries. This eliminates the need for data movement and reduces processing time compared to other options that involve data transfer. Minimized Development Effort: Since you're already familiar with SQL, writing queries for mm-max scaling and bucketing requires minimal additional development effort compared to learning and implementing new frameworks like Spark or Dataflow. Cost-Effective: BigQuery's serverless architecture scales processing power based on your workload. This can be more cost-effective than managing separate processing clusters like Dataproc.
shadz10 👍 2 Selected: B
B - Keeps the preprocessing algorithm seperate from the model
36bdc1e 👍 2
C This option allows you to leverage the power and simplicity of TensorFlow to preprocess and transform the data with simple Python code
BlehMaks 👍 1 Selected: B
BigQuery can do both transformations https://cloud.google.com/bigquery/docs/manual-preprocessing#numerical_functions
b1a8fae 👍 1 Selected: B
BigQuery (SQL) is the easiest, cheapest approach

Comments & Corrections

No comments yet — spotted an error or have a note? Share it below.

Log in to comment, report an error, or add a note about this question.

Submitted for moderation before publishing. Keep it helpful and respectful.

Expert Analysis

Why the Answer Is Correct

Option B leverages BigQuery’s native SQL capabilities to apply min-max scaling and bucketing directly on the dataset. This approach eliminates expensive data egress and network transfer between BigQuery and Vertex AI, significantly reducing both cost and latency. By keeping transformations in the warehouse, you also avoid duplicating logic across multiple model experiments. As noted by top voters, this method minimizes development effort while maintaining high performance for large-scale feature engineering [Comment 1, 6].

Why the Other Options Are Wrong

Option A (Dataproc/Spark) and Option D (Dataflow) introduce managed compute clusters that incur higher operational costs and require additional pipeline orchestration, contradicting the goal of minimizing expense and effort. Option C shifts preprocessing into the TensorFlow graph, which means the scaling and bucketing operations are recalculated during every training step, slowing down convergence and increasing GPU/TPU utilization. External pipelines also complicate version control and experiment tracking compared to declarative SQL queries [Comment 4].

Community Comment Notes

The majority of practitioners emphasize that BigQuery SQL natively supports numerical transformations like min_max_scaling and bucketize, making it the most straightforward path [Comment 5]. Several users highlighted that separating preprocessing from the model architecture maintains cleaner codebases and aligns with modern MLOps practices [Comment 2]. While some argued for TF layers to reduce storage footprint, the consensus remains that warehouse-side SQL is optimal for batch historical data feeding Vertex AI [Comment 3, 4].

Official Reference

Exam Strategy

When designing ML data pipelines on GCP, always evaluate whether transformations can be pushed down to the data warehouse using SQL before opting for compute-heavy frameworks like Dataproc or Dataflow. Pushing logic closer to the data reduces egress fees, speeds up iteration cycles, and simplifies infrastructure management.

Related Analysis

Practice All PMLE Questions

Access 65 questions with complete answers and detailed explanations.

View Full PMLE Practice Test →

← Back to PMLE Study Guide