Data tools, Feature Store, notebooks and experiment tracking
Section 2 on Google Cloud: where each kind of data lives, choosing BigQuery, Dataflow, Spark or pandas for preprocessing, the BigQuery-backed Feature Store, protecting PII, Workbench vs Colab Enterprise and their security, and tracking experiments, artifacts and lineage.
1. Where data lives
Data
Store
Why
Structured / tabular
BigQuery
SQL exploration, BQML, direct reading by AutoML, pipelines and the Feature Store
Images, audio, video, documents
Cloud Storage, with a manifest (CSV/JSONL of URIs and labels)
Cheap object storage; training reads it through Cloud Storage FUSE at /gcs/<bucket>
High-throughput training input
TFRecord files or sharded Parquet in Cloud Storage
Large sequential reads beat millions of small files
Streaming events
Pub/Sub → Dataflow → BigQuery / Feature Store
Real-time features and monitoring
Low-latency key lookups for serving
Feature Store online serving (or Bigtable)
Millisecond reads by entity ID
Reading data efficiently for training
BigQuery Storage Read API: fast, parallel streaming of table rows into training jobs (used by BigQuery connectors in TensorFlow, PyTorch and Spark).
Cloud Storage FUSE: custom training jobs see buckets as files under /gcs/BUCKET.
Prefer fewer, larger files (TFRecord, Parquet shards of roughly 100 MB or more) over millions of tiny files.
Keep data and compute in the same region to avoid egress cost and latency.
Use managed datasets (tabular, image, text, video) on Agent Platform for AutoML and labelled data versioning.
2. Choosing a preprocessing tool
Tool
Best for
Not for
BigQuery SQL
Joins, aggregates, window features on structured data at any scale; serverless
Complex per-record Python logic, image processing
Dataflow (Apache Beam)
Large batch and streaming pipelines with the same code; autoscaling; TensorFlow Transform runs on it
Small data that fits in memory (overkill)
Dataproc / Serverless for Apache Spark
Existing Spark or Hadoop code and skills; lift-and-shift
Greenfield streaming when Dataflow fits
pandas / in-memory Python in a notebook
Exploration and small datasets
Anything that doesn't fit in one machine's memory
Data preparation in BigQuery (Gemini-assisted)
Low-code cleaning by analysts
Production pipelines needing tests and versioning
Feature engineering itself (leakage, splits, encoding, scaling, imbalance) is covered in depth in ML fundamentals 1.
Data validation and quality
Tool
Use
TensorFlow Data Validation (TFDV)
Infer a schema, compute statistics, detect anomalies and skew between datasets
Dataplex Universal Catalog data quality and profiling
Rules and profiles on BigQuery tables; lineage and discovery across the data estate
Pipeline validation steps
Fail fast on row counts, nulls, ranges and schema changes before training
Labelling data
Write clear labelling guidelines with examples; measure agreement between labellers.
Use Gemini to pre-label and humans to review, or active learning to label the most informative examples first.
Store labels with their source and version so models can be traced to the labels used.
3. Feature Store on Agent Platform
The Feature Store lets teams define features once and reuse them for training and serving, which removes a major source of training-serving skew. The current version is BigQuery-native:
Feature data stays in BigQuery (tables or views). A feature group registers a BigQuery source and its features.
Offline: training data comes from BigQuery with point-in-time correct lookups (feature values as they were at each label's timestamp), avoiding leakage.
Online: an online store with feature views syncs selected features for low-latency serving. Bigtable online serving suits large data; optimized online serving gives the lowest latency and supports embedding (vector) retrieval.
Sync on a schedule or continuously; serve with FetchFeatureValues by entity ID.
The older "legacy" Feature Store (featurestores, entity types, its own storage) still appears in study material. New designs use the BigQuery-backed version.
Offline (training) Online (serving)
BigQuery tables/views ── feature groups ──► feature views ──sync──► online store
│ │
point-in-time join with labels FetchFeatureValues(entity_id)
▼ ▼
training dataset endpoint / app
4. Privacy and sensitive data
Control
Use
Sensitive Data Protection (formerly Cloud DLP)
Discover and classify PII (personally identifiable information) in BigQuery and Cloud Storage; de-identify by masking, redaction, bucketing, date shifting, tokenization or format-preserving encryption before training
IAM, least privilege, separate service accounts
Who can read raw vs de-identified data
BigQuery column-level security, policy tags, row-level security, dynamic data masking
Analysts see masked columns; the training pipeline reads only what it needs
CMEK (customer-managed encryption keys)
Compliance requirement to control keys for datasets, models, endpoints and pipelines
VPC Service Controls
A perimeter that stops data exfiltration from BigQuery, Cloud Storage and Agent Platform to outside projects
Dropping the "name" column isn't de-identification: free text, IDs and combinations of quasi-identifiers (ZIP code, birth date, gender) still identify people. Use Sensitive Data Protection to find and transform them.
5. Prototyping in notebooks
Agent Platform Workbench (instances)
Colab Enterprise
What
A JupyterLab VM you configure: machine type, GPUs, disks, custom containers, extensions
A managed Colab notebook with runtimes from templates; notebooks stored and shared like documents
Best for
Long-running, customized environments; data scientists who need control and terminal access
Quick collaboration and sharing, minimal setup, consistent runtimes set by admins
Shared features
BigQuery and Cloud Storage integration, Gemini code assistance, scheduled notebook runs (executions), IAM-controlled access, CMEK and VPC options
Security and collaboration best practices
Run the notebook as a dedicated service account with least privilege; for personal instances use single-user access (end-user credentials) so actions are attributable.
No public IP, a private VPC subnet, and VPC Service Controls around sensitive projects; reach Google APIs through Private Google Access.
CMEK on disks when required; never store keys or passwords in notebooks: use Secret Manager.
Idle shutdown to stop paying for forgotten GPUs.
Keep code in Git (Workbench has a Git extension); move reusable code into packages and pipelines rather than sharing notebooks by email.
Admins standardize runtimes with Colab Enterprise runtime templates or Workbench custom container images.
Frameworks and models
Both environments come with TensorFlow, PyTorch, scikit-learn, XGBoost and JAX images, plus the Agent Platform SDK. From a notebook you can call Gemini, deploy open models from Model Garden for experiments, or open a Model Garden model card's sample notebook directly in Colab Enterprise.
A notebook is a prototyping tool, not a production system. "Schedule the notebook to retrain nightly in production" loses to a pipeline with validation, lineage and alerting, except for genuinely lightweight reporting jobs.
6. Experiments, lineage and the registry
Tool
Use
Experiments (Agent Platform)
Log parameters, metrics and artifacts per run from notebooks or jobs; compare runs side by side; autologging for common frameworks
Agent Platform TensorBoard
Managed TensorBoard for loss curves, profiles and comparisons across training jobs
Pipelines (Kubeflow Pipelines on Agent Platform)
Repeatable multi-step experiments with automatic lineage, caching and parameters
Kubeflow Pipelines on GKE
When you must run the open-source stack yourself (existing Kubeflow investment, custom cluster needs)
ML Metadata
The store behind lineage: artifacts (datasets, models), executions (steps) and contexts (experiments, pipeline runs)
Model Registry
Versions and aliases of models, with evaluation results attached
from google.cloud import aiplatform
aiplatform.init(project="PROJECT_ID", location="us-central1",
experiment="churn-xgb", experiment_tensorboard=True)
aiplatform.start_run("run-depth6-lr01")
aiplatform.log_params({"max_depth": 6, "learning_rate": 0.1})
# ... train ...
aiplatform.log_metrics({"auc_pr": 0.71, "recall_at_p90": 0.42})
aiplatform.end_run()
aiplatform.get_experiment_df() # compare runs as a DataFrame
Lineage questions and where they're answered
Question
Answered by
Which run had the best PR AUC, and with which parameters?
Experiments (compare runs)
Why did loss plateau at epoch 12?
Agent Platform TensorBoard
Which dataset version and pipeline run produced the production model?
Pipeline lineage in ML Metadata, linked from Model Registry
Which model version is serving, and what was its evaluation?
Model Registry (versions, aliases such as default or champion, attached evaluations)
Comparing two models on different test sets, or tuning the threshold on the test set, invalidates the comparison. Tune on validation; report on a held-out test set.
7. Lab: from raw data to a tracked experiment
Create a Colab Enterprise notebook (or a Workbench instance with idle shutdown on, no public IP) in us-central1.
Run Sensitive Data Protection inspection on a sample table with a free-text column; create a de-identified copy (masking or tokenization).
Register the de-identified BigQuery table as a Feature Store feature group; create a feature view with two features and sync it to an online store; fetch values for one entity ID.
Build a point-in-time training set by joining labels with feature values as of each label timestamp.
Train two XGBoost variants in the notebook; log parameters and metrics to Experiments; compare them with get_experiment_df().
Clean up: delete the online store, feature view, de-identified tables and notebook runtime.
8. "Which data tool?" chooser
Pick an item to see what it means, why, and the tempting wrong choice.
Pick one above.
9. Scenarios
Exam-style situations: how to diagnose each one, the likely cause and the fix.
10. Searchable reference
Item
Meaning
11. Flashcards (click to flip)
12. Common gotchas in one list
Dataflow for big batch and streaming with one codebase; Dataproc for existing Spark.
Feature Store is BigQuery-native now: offline in BigQuery, online via feature views.
Point-in-time joins prevent leakage in training sets built from feature history.
Dropping obvious PII columns isn't de-identification. Use Sensitive Data Protection.
VPC Service Controls stop exfiltration, even with valid credentials; IAM alone doesn't.
No secrets in notebooks: Secret Manager and service accounts.
Notebooks are for prototyping; production retraining belongs in pipelines.
Colab Enterprise for easy sharing and admin-set runtimes; Workbench for customized VMs.
Experiments compare runs; ML Metadata holds lineage; Model Registry holds versions.