PROFESSIONAL-MACHINE-LEARNING-ENGINEER practice question 34 of 35

You work on the data science team for a multinational beverage company. You need to develop an ML model to predict the company’s profitability for a…

Full set: 283 questions
You work on the data science team for a multinational beverage company. You need to develop an ML model to predict the company’s profitability for a new line of naturally flavored bottled waters in different locations. You are provided with historical data that includes product types, product sales volumes, expenses, and profits for all regions. What should you use as the input and output for your model?
Answer options
A: Use latitude, longitude, and product type as features. Use profit as model output.
B: Use latitude, longitude, and product type as features. Use revenue and expenses as model outputs.
C: Use product type and the feature cross of latitude with longitude, followed by binning, as features. Use profit as model output. Correct answer
D: Use product type and the feature cross of latitude with longitude, followed by binning, as features. Use revenue and expenses as model outputs.
Correct Answer:
C. Use product type and the feature cross of latitude with longitude, followed by binning, as features. Use profit as model output.
Explanation

The primary goal is to predict "profitability," making 'profit' the most direct and appropriate model output. For input features, raw latitude and longitude are often suboptimal as they imply a smooth, linear relationship across geography. The superior approach, described in option C, is to perform feature engineering. Feature crossing latitude and longitude creates a new feature representing a specific geographic grid. Subsequently, binning (also known as bucketizing) this feature converts the continuous location data into discrete, categorical regions. This allows the model to learn distinct, non-linear patterns and assign a specific weight to each geographical area, which is more effective for capturing real-world location-based trends.

Why Incorrect

A. Using raw latitude and longitude as continuous features is less effective, as it assumes a simple linear relationship between location and profit, which is rarely true in practice.
B. Predicting two outputs (revenue and expenses) unnecessarily complicates the model when the direct target, profit, can be modeled as a single output.
D. While this option correctly uses advanced feature engineering for location, it incorrectly specifies two model outputs instead of the single, direct target of profit.

References

1. Google Developers, Machine Learning Crash Course, "Feature Crosses": This source explains the rationale for creating synthetic features by crossing categorical or binned continuous features. It notes, "Crossing two features...enables a model to learn separate weights for each combination of features," which is precisely the benefit of crossing binned latitude and longitude to learn location-specific effects.

Reference: Google Developers. (n.d.). Feature Crosses. Machine Learning Crash Course. Retrieved from https://developers.google.com/machine-learning/crash-course/feature-crosses/video-lecture

2. Google Developers, Machine Learning Crash Course, "Bucketing": This module details the process of converting a continuous feature, like geographic coordinates, into multiple binary features called buckets or bins. This technique allows a model to learn more complex, non-linear relationships. For latitude/longitude, this means the model can learn different patterns for different geographic regions.

Reference: Google Developers. (n.d.). Bucketing. Machine Learning Crash Course. Retrieved from https://developers.google.com/machine-learning/crash-course/bucketing/video-lecture

3. Google Cloud Documentation, BigQuery ML, BUCKETIZE function: The official documentation for Google's BigQuery ML provides the BUCKETIZE function specifically for this purpose. The documentation states it "buckets a continuous numerical expression into a STRING." This directly supports the practice of binning continuous features like latitude or longitude for use in ML models within the Google Cloud ecosystem.

Reference: Google Cloud. (2023). BUCKETIZE function. Google Cloud Documentation. Retrieved from https://cloud.google.com/bigquery/docs/reference/standard-sql/bigqueryml-syntax-bucketize

4. Google Cloud Documentation, BigQuery ML, ML.FEATURECROSS function: This documentation describes the function for creating feature crosses in BigQuery ML. It states that the function "Takes one or more categorical features and returns the feature cross." This is the practical implementation of the technique described in the correct answer.

Reference: Google Cloud. (2023). ML.FEATURECROSS function. Google Cloud Documentation. Retrieved from https://cloud.google.com/bigquery/docs/reference/standard-sql/bigqueryml-syntax-feature-cross

Scroll to Top