Using SageMaker Data Wrangler, an engineer finds a text categorical feature with thousands of slightly different values caused by spelling errors. Which encoding method should be used so the processed feature can be used for classification?
Choose an answer
Tap an option to check your answer.
Correct answer: Use similarity encoding to group and represent closely spelled categories..
Why this is the answer
Similarity encoding is the most appropriate method here because it is designed to handle categorical features with high cardinality and spelling variations. It groups similar-sounding or similarly-spelled categories, effectively reducing the number of unique categories while preserving the underlying meaning. This helps mitigate the impact of spelling errors and prepares the data for classification models. Ordinal encoding assigns a numerical order to categories, which is unsuitable for nominal data like text categories with spelling errors, as it implies a non-existent rank. One-hot encoding would create thousands of new features, leading to a sparse dataset and potential curse of dimensionality, making it inefficient and potentially detrimental to model performance. Target encoding maps categories to the mean of the target variable, which might not effectively address the issue of spelling errors and high cardinality in the input feature itself.
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