PROFESSIONAL-MACHINE-LEARNING-ENGINEER practice question 23 of 35
You are an ML engineer at a global car manufacturer. You need to build an ML model to predict car sales in different cities around the world. Which features or feature crosses should you use to train city-specific relationships between car type and number of sales?
Full set: 283 questionsTo capture "city-specific relationships," the model needs to learn the interaction between a geographical location and the car type. A feature cross is the ideal technique for this. Location is represented by latitude and longitude, which should be binned (discretized) to represent geographical regions. The car type is a categorical feature that should be one-hot encoded. By creating a single feature cross from all three (binned latitude, binned longitude, and one-hot encoded car type), you create a new feature that is active only for a specific car type within a specific geographical grid. This allows the model to learn a unique predictive weight for that exact combination, directly modeling the required relationship.
A: Using individual features does not explicitly model the interaction. The model must learn the complex relationship implicitly, which is less effective and requires more data. B: Crossing raw, continuous latitude and longitude values is mathematically unsound and does not create a meaningful, interpretable feature for specific regions. D: Creating two separate crosses (latitude x cartype and longitude x cartype) fails to capture the crucial three-way interaction that defines a specific grid cell and car type.
1. Google Developers, Machine Learning Crash Course, "Feature Crosses": This official Google courseware explains the concept. It states, "Crossing one-hot encoded feature vectors can create a very large feature space." It provides a direct analogy: "Let's suppose we bin latitude and longitude... We can then form a feature cross of these two features... [binnedlatitude X binnedlongitude]... Now suppose we also want to factor the type of home... We could cross this feature with other features. For example, if you cross the location feature with a housetype feature..." This directly supports crossing binned location features with a categorical type feature, as described in option C.
Source: Google Developers. (n.d.). Feature Crosses. Machine Learning Crash Course. Retrieved from https://developers.google.com/machine-learning/crash-course/feature-crosses/encoding-feature-crosses
2. TensorFlow Core Documentation, tf.featurecolumn.crossedcolumn: This official documentation describes the function used to implement feature crosses. The function takes a list of keys, which can be "categoricalcolumnwith... or a BucketizedColumn." This confirms that the correct methodology is to cross bucketized (binned) continuous features like latitude/longitude with categorical features.
Source: TensorFlow Authors. (n.d.). tf.featurecolumn.crossedcolumn. TensorFlow Core v2.15.0. Retrieved from https://www.tensorflow.org/apidocs/python/tf/featurecolumn/crossedcolumn
3. Google Cloud Documentation, "Feature engineering overview": This documentation for Google's Vertex AI platform describes feature crossing as a key technique. It notes, "Crossing two or more features... can provide predictive abilities beyond what the individual features can provide. When you cross features, you are essentially creating a new feature for every combination of values of the contributing features." This validates the principle of combining multiple features (binned latitude, binned longitude, car type) to create a more predictive composite feature.
Source: Google Cloud. (n.d.). Feature engineering overview. Vertex AI Documentation. Retrieved from https://cloud.google.com/vertex-ai/docs/feature-engineering/overview
Keep practicing
Take the free PROFESSIONAL-MACHINE-LEARNING-ENGINEER practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other PROFESSIONAL-MACHINE-LEARNING-ENGINEER practice questions
- Question 1You work for an advertising company and want to understand the effectiveness of your comp…
- Question 2You developed a custom model by using Vertex Al to forecast the sales of your company s p…
- Question 3You are an ML engineer at a global shoe store. You manage the ML models for the company's…
- Question 5During batch training of a neural network, you notice that there is an oscillation in the…
- Question 6You want to rebuild your ML pipeline for structured data on Google Cloud. You are using P…
- Question 7Your team is building a convolutional neural network (CNN)-based architecture from scratc…
