MLS-C01 Question 102
Select 3You are building a machine learning model to predict house prices. Your dataset includes a 'Year Built' feature, which represents the year a house was constructed, and a 'Neighborhood' feature, which is a categorical variable. To improve the model's performance, you decide to apply feature engineering techniques. Which of the following steps would be appropriate for feature engineering in this scenario?
- A
Create a new feature representing the house's age by subtracting 'Year Built' from the current year.
- B
Apply one-hot encoding to the 'Neighborhood' feature to convert it into numerical values.
- C
Remove the 'Year Built' feature entirely to avoid overfitting the model.
- D
Group 'Neighborhood' categories into fewer bins based on median house prices.
- E
Apply Principal Component Analysis (PCA) to the 'Year Built' feature to reduce dimensionality.
Show answer and explanation
Correct answers: A, B, D
Explanation
Feature engineering is a critical step in preparing data for machine learning models. In this scenario, creating a new feature for the house's age, applying one-hot encoding to categorical variables, and grouping categories into fewer bins based on domain knowledge are effective strategies. These techniques help make the dataset more informative and suitable for the model while reducing complexity where necessary.
- A. Correct.
Creating a new feature for the house's age is a common practice in feature engineering, as it provides a more meaningful representation of the 'Year Built' feature for the model.
- B. Correct.
Applying one-hot encoding to the 'Neighborhood' feature is appropriate because it is a categorical variable. One-hot encoding converts categories into numerical values, which are suitable for machine learning algorithms.
- C. Incorrect.
Removing the 'Year Built' feature entirely is not justified unless there is evidence that it contributes no meaningful information or causes overfitting. In this case, it can be transformed into a more useful feature (e.g., house age).
- D. Correct.
Grouping 'Neighborhood' categories based on median house prices can reduce the cardinality of the feature and capture useful information, which improves model performance.
- E. Incorrect.
Applying PCA to the 'Year Built' feature is not appropriate because PCA is used for dimensionality reduction on high-dimensional numerical datasets, not individual features like 'Year Built'.