Preparing data for feature engineering and model training and serving
Preparing data for ML on Google Cloud centers on BigQuery ML, which lets you build, train, and serve models directly on data stored in BigQuery using SQL, minimizing data movement and simplifying feature engineering. Google Cloud emphasizes consistent preprocessing between training and serving to avoid training-serving skew, and provides built-in functions and clauses in BigQuery ML to encode this logic once.
1 · Learn the must-know
- The TRANSFORM clause in CREATE MODEL lets you define feature preprocessing (e.g., ML.STANDARDIZE, ML.BUCKETIZE,
ML.FEATURE_CROSS) that is automatically reapplied during ML.PREDICT and ML.EVALUATE, preventing training-serving skew. - BigQuery ML automatically splits data into training and evaluation sets by default, but you can control this explicitly via the
DATA_SPLIT_METHODandDATA_SPLIT_COLoptions for reproducible, leakage-free splits. - Categorical columns in BigQuery ML are automatically one-hot encoded unless you specify otherwise, so explicit encoding steps are often unnecessary for basic models.
- ML.EVALUATE, ML.PREDICT, and
ML.EXPLAIN_PREDICTare the standard functions to assess and serve predictions from a trained BigQuery ML model without exporting data elsewhere. - For non-SQL or more complex feature pipelines, Vertex AI Feature Store (now part of Vertex AI Feature Store / Feature Registry) is the managed service for storing, sharing, and serving consistent features across training and low-latency online serving.
- Highly imbalanced label data and missing/null values are common gotchas: BigQuery ML requires you to handle nulls and consider class weighting (e.g.,
CLASS_WEIGHTSoption) before or during model creation to get reliable results.
2 · Check your understanding
A data engineer at a retail company is building a BigQuery ML linear regression model to predict order value. The training query normalizes a numeric feature and buckets another before feeding them into CREATE MODEL. When the model is later used for batch scoring with ML.PREDICT on new orders, the engineer wants the exact same normalization and bucketing to be applied automatically, without duplicating the logic in the prediction query. What should the engineer do?
What you have tried across GCP PDE's objectives, not a readiness score.
Designing data processing systems~22% of the exam0 of 17 tried
Ingesting and processing the data~25% of the exam0 of 11 tried
Storing the data~20% of the exam0 of 13 tried
Preparing and using data for analysis~15% of the exam0 of 11 tried
Maintaining and automating data workloads~18% of the exam0 of 15 tried
3 · Keep going
Ready for more? Take a weighted mock or try free practice questions.