nerdexam
Google

PROFESSIONAL-MACHINE-LEARNING-ENGINEER · Question #242

You are using Keras and TensorFlow to develop a fraud detection model. Records of customer transactions are stored in a large table in BigQuery. You need to preprocess these records in a cost-effectiv

The correct answer is C. Perform preprocessing in BigQuery by using SQL. Use the BigQueryClient in TensorFlow to read. Preprocessing data directly in BigQuery using SQL is cost-effective and efficient, especially when the data originates from and will be used for batch inference within BigQuery.

Submitted by hassan_iq· Apr 18, 2026Data processing and feature engineering

Question

You are using Keras and TensorFlow to develop a fraud detection model. Records of customer transactions are stored in a large table in BigQuery. You need to preprocess these records in a cost-effective and efficient way before you use them to train the model. The trained model will be used to perform batch inference in BigQuery. How should you implement the preprocessing workflow?

Options

  • AImplement a preprocessing pipeline by using Apache Spark, and run the pipeline on Dataproc.
  • BLoad the data into a pandas DataFrame. Implement the preprocessing steps using pandas
  • CPerform preprocessing in BigQuery by using SQL. Use the BigQueryClient in TensorFlow to read
  • DImplement a preprocessing pipeline by using Apache Beam, and run the pipeline on Dataflow.

How the community answered

(29 responses)
  • A
    3% (1)
  • B
    14% (4)
  • C
    76% (22)
  • D
    7% (2)

Why each option

Preprocessing data directly in BigQuery using SQL is cost-effective and efficient, especially when the data originates from and will be used for batch inference within BigQuery.

AImplement a preprocessing pipeline by using Apache Spark, and run the pipeline on Dataproc.

Apache Spark on Dataproc is a valid option for large-scale data processing, but introducing an external Spark cluster might add operational overhead and cost compared to leveraging BigQuery's native capabilities.

BLoad the data into a pandas DataFrame. Implement the preprocessing steps using pandas

Loading a large BigQuery table into a pandas DataFrame would likely lead to out-of-memory errors for a 'large table' and is not scalable for significant datasets.

CPerform preprocessing in BigQuery by using SQL. Use the BigQueryClient in TensorFlow to readCorrect

Performing preprocessing in BigQuery using SQL is highly efficient and cost-effective for large datasets already residing in BigQuery, and the `BigQueryClient` in TensorFlow can directly read the preprocessed data for model training. This approach minimizes data movement and leverages BigQuery's scalable query engine for preprocessing.

DImplement a preprocessing pipeline by using Apache Beam, and run the pipeline on Dataflow.

Apache Beam on Dataflow is excellent for large-scale data processing pipelines, but for data already in BigQuery and intended for batch inference within BigQuery, using SQL directly in BigQuery is often simpler, more cost-effective, and more integrated.

Concept tested: BigQuery for ML preprocessing and data ingestion

Source: https://cloud.google.com/bigquery-ml/docs/introduction

Topics

#BigQuery#SQL Preprocessing#TensorFlow Data Input#Cost-effective processing

Community Discussion

No community discussion yet for this question.

Full PROFESSIONAL-MACHINE-LEARNING-ENGINEER Practice