A crime-pattern-analysis model uses a neighborhood/district code field with several hundred distinct values as an input feature. One-hot encoding this field would create hundreds of new sparse columns and bloat the feature set. Which SageMaker Data Wrangler encoding approach better fits this high-cardinality field?
Select an answer to reveal the explanation.
Short Explanation
Giving every neighborhood its own separate column is like giving every student a personal spreadsheet tab, it works for a small class but falls apart at hundreds of names. A compact encoding like target or label encoding scales without ballooning your feature set.
Full Explanation
Mechanism: for a high-cardinality categorical field like a several-hundred-value district code, encodings such as target encoding or ordinal/label encoding represent each category with a single compact value derived from its relationship to the target or a simple index, avoiding the hundreds of sparse, mostly-zero columns that one-hot encoding would otherwise create. Why the wrong options fail by concept: insisting one-hot encoding is the only available option misunderstands the toolset, Data Wrangler offers multiple categorical-encoding transforms precisely because different cardinality levels call for different approaches, and defaulting to one-hot here recreates the exact bloat problem the scenario describes. Mean imputation addresses missing values in numeric fields, it has nothing to do with encoding a categorical identifier that is already present and simply needs a compact numeric representation. Treating the district code as continuous and scaling it implies a false ordinal relationship between arbitrary codes, a district numbered higher isn't mathematically greater in any meaningful sense, so scaling misrepresents what the feature means. Scope caveat: target encoding in particular risks leaking target information if it's computed across the full dataset rather than fit within cross-validation folds or on training data only. Operational check: inspect the resulting feature column count and distribution in the Data Wrangler flow to confirm the encoding avoided a sparse, high-dimensional explosion.