A machine learning engineer is preparing a dataset for a classification model. The dataset contains a categorical feature with high cardinality (e.g., zip code). Which of the following techniques is most appropriate to handle this feature before training?
Answer
Target encoding
Explanation
Target encoding replaces categories with the mean of the target variable, which is effective for high-cardinality features and avoids the curse of dimensionality. One-hot encoding would create too many features, label encoding implies order, and binary encoding may still create many features.
Last reviewed: October 2026
Reviewed by FirstInTest Editorial Team
Related questions
A machine learning engineer is preparing a dataset for a binary classification model. The dataset contains 95% negative examples and 5% positive examples. Which evaluation metric is most appropriate to assess the model's performance on the positive class?
View question →
A machine learning engineer wants to reduce the size of a trained neural network model before deploying it to a resource-constrained edge device. Which technique should they use?
View question →
A machine learning engineer is using Amazon SageMaker to train a model on a large dataset stored in Amazon S3. They want to minimize training time. Which input mode should they use?
View question →
A machine learning engineer needs to ensure that a deployed model provides explanations for its predictions. Which SageMaker feature should they use?
View question →
A machine learning engineer is training a model on a dataset with missing values. Which of the following are appropriate strategies to handle missing data? (Select TWO.)
View question →
A machine learning engineer is using Amazon SageMaker to deploy a model for real-time inference. They need to automatically scale the endpoint based on traffic. Which SageMaker feature should they use?
View question →