A county public-health team will train a housing affordability classifier and must encode zoning category codes. What feature-engineering choice best fits high-cardinality civic categories?
Select an answer to reveal the explanation.
Short Explanation
Zoning labels are names of buckets, not temperatures on a thermometer. Encode them as categories—one-hot or another cardinality-aware method—so the model does not treat code 40 as twice code 20. Leaving them as fake continuous numbers sends the wrong signal.
Full Explanation
Zoning category codes are categorical civic attributes, not continuous magnitudes. For a housing affordability classifier, apply an appropriate categorical encoding such as one-hot encoding or a cardinality-aware alternative (for example, hashing, embeddings, or carefully leakage-controlled target encoding when cardinality is high). Correct encoding prevents the model from inventing false numeric order among zone labels while still making the feature usable for supervised learning on public-health housing outcomes.
Storing zoning as free-form paragraphs with no encoding leaves unstructured text where a controlled category feature was required and blocks standard tabular learners. Using raw integer codes as if they were continuous magnitudes teaches the model that zone 40 is "twice" zone 20, which is usually meaningless for zoning ordinances. Dropping every zoning-related column avoids the encoding decision by discarding a core housing-policy signal the classifier needs.
Exam caveat: one-hot can explode width with high-cardinality municipal codes; choose cardinality-aware methods when the zone list is large, and keep unseen-category handling explicit for new codes in production scoring. Operational check: fit the encoder on training zones only, verify output dimension and sparsity, score a holdout with unseen codes handled as planned, and compare metrics against a mistaken ordinal-integer baseline to prove the encoding choice matters.