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.
Question
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)- A3% (1)
- B14% (4)
- C76% (22)
- D7% (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.
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.
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.
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.
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
Community Discussion
No community discussion yet for this question.