← All Google Cloud AI guidesSection 2 · 2.1–2.3

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

DataStoreWhy
Structured / tabularBigQuerySQL exploration, BQML, direct reading by AutoML, pipelines and the Feature Store
Images, audio, video, documentsCloud 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 inputTFRecord files or sharded Parquet in Cloud StorageLarge sequential reads beat millions of small files
Streaming eventsPub/Sub → Dataflow → BigQuery / Feature StoreReal-time features and monitoring
Low-latency key lookups for servingFeature Store online serving (or Bigtable)Millisecond reads by entity ID

Reading data efficiently for training

2. Choosing a preprocessing tool

ToolBest forNot for
BigQuery SQLJoins, aggregates, window features on structured data at any scale; serverlessComplex per-record Python logic, image processing
Dataflow (Apache Beam)Large batch and streaming pipelines with the same code; autoscaling; TensorFlow Transform runs on itSmall data that fits in memory (overkill)
Dataproc / Serverless for Apache SparkExisting Spark or Hadoop code and skills; lift-and-shiftGreenfield streaming when Dataflow fits
pandas / in-memory Python in a notebookExploration and small datasetsAnything that doesn't fit in one machine's memory
Data preparation in BigQuery (Gemini-assisted)Low-code cleaning by analystsProduction 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

ToolUse
TensorFlow Data Validation (TFDV)Infer a schema, compute statistics, detect anomalies and skew between datasets
Dataplex Universal Catalog data quality and profilingRules and profiles on BigQuery tables; lineage and discovery across the data estate
Pipeline validation stepsFail fast on row counts, nulls, ranges and schema changes before training

Labelling data

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:

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

ControlUse
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 accountsWho can read raw vs de-identified data
BigQuery column-level security, policy tags, row-level security, dynamic data maskingAnalysts 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 ControlsA perimeter that stops data exfiltration from BigQuery, Cloud Storage and Agent Platform to outside projects
Differential privacy, k-anonymity checks, aggregationReduce re-identification risk in shared data
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
WhatA JupyterLab VM you configure: machine type, GPUs, disks, custom containers, extensionsA managed Colab notebook with runtimes from templates; notebooks stored and shared like documents
Best forLong-running, customized environments; data scientists who need control and terminal accessQuick collaboration and sharing, minimal setup, consistent runtimes set by admins
Shared featuresBigQuery and Cloud Storage integration, Gemini code assistance, scheduled notebook runs (executions), IAM-controlled access, CMEK and VPC options

Security and collaboration best practices

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

ToolUse
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 TensorBoardManaged 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 GKEWhen you must run the open-source stack yourself (existing Kubeflow investment, custom cluster needs)
ML MetadataThe store behind lineage: artifacts (datasets, models), executions (steps) and contexts (experiments, pipeline runs)
Model RegistryVersions 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

QuestionAnswered 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)
Metrics, thresholds and evaluation methods are covered in ML fundamentals 2 and LLM and agent evaluation.
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

  1. Create a Colab Enterprise notebook (or a Workbench instance with idle shutdown on, no public IP) in us-central1.
  2. Run Sensitive Data Protection inspection on a sample table with a free-text column; create a de-identified copy (masking or tokenization).
  3. 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.
  4. Build a point-in-time training set by joining labels with feature values as of each label timestamp.
  5. 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

ItemMeaning

11. Flashcards (click to flip)

12. Common gotchas in one list

  1. Dataflow for big batch and streaming with one codebase; Dataproc for existing Spark.
  2. Feature Store is BigQuery-native now: offline in BigQuery, online via feature views.
  3. Point-in-time joins prevent leakage in training sets built from feature history.
  4. Dropping obvious PII columns isn't de-identification. Use Sensitive Data Protection.
  5. VPC Service Controls stop exfiltration, even with valid credentials; IAM alone doesn't.
  6. No secrets in notebooks: Secret Manager and service accounts.
  7. Notebooks are for prototyping; production retraining belongs in pipelines.
  8. Colab Enterprise for easy sharing and admin-set runtimes; Workbench for customized VMs.
  9. Experiments compare runs; ML Metadata holds lineage; Model Registry holds versions.
  10. Many tiny files starve GPUs; shard and prefetch.
  11. Co-locate data and compute by region.

13. Practice quiz (20 questions)

Score: 0 / 0
← LLM and agent evaluationNext: Training, tuning and hardware →