For a fully connected neural network predicting housing prices, how should you encode latitude and longitude to capture location effects?
Choose an answer
Tap an option to check your answer.
Correct answer: Create a feature cross of latitude and longitude, bucketize it at the minute level and use L1 regularization during optimization..
Why this is the answer
The correct approach is to create a feature cross of latitude and longitude, bucketize it at the minute level, and use L1 regularization. Feature crossing latitude and longitude allows the model to learn interactions between these two features, representing specific geographic areas. Bucketizing at the minute level creates discrete, granular regions, which is more effective than raw coordinates for capturing localized effects on housing prices. L1 regularization (Lasso) helps in feature selection by driving some weights to zero, effectively simplifying the model and preventing overfitting, especially when dealing with a large number of bucketed features. Providing latitude and longitude as raw input vectors might not capture the non-linear, interactive effects of location effectively. A simple numeric feature cross without bucketing would still treat location as a continuous variable, which might not be ideal for capturing distinct neighborhood impacts. While L2 regularization (Ridge) also prevents overfitting, L1 is often preferred when feature selection is desired, as it can eliminate less important bucketed location features.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed