MLA-C01 · Question #222
An ML engineer is building a logistic regression model to predict customer churn for subscription services. The ML engineer is using a dataset that contains two string variables: location and…
The correct answer is B. Apply one-hot encoding to location. Apply ordinal encoding to job_seniority_level. One-hot encoding is appropriate for a categorical variable with a small number of distinct values like location, avoiding any artificial ordering. Ordinal encoding fits job_seniority_level because the values have a natural order, allowing the logistic regression model to…
Question
An ML engineer is building a logistic regression model to predict customer churn for subscription services. The ML engineer is using a dataset that contains two string variables: location and job_seniority_level. The location variable has 3 distinct values, and the job_seniority_level variable has over 10 distinct values. The ML engineer must perform preprocessing on the variables. Which solution will meet this requirement?
Options
- AApply tokenization to location. Apply ordinal encoding to job_seniority_level.
- BApply one-hot encoding to location. Apply ordinal encoding to job_seniority_level
- CApply binning to location. Apply standard scaling to job_seniority_level.
- DApply one-hot encoding to location. Apply standard scaling to job_seniority_level.
How the community answered
(28 responses)- A7% (2)
- B75% (21)
- C4% (1)
- D14% (4)
Explanation
One-hot encoding is appropriate for a categorical variable with a small number of distinct values like location, avoiding any artificial ordering. Ordinal encoding fits job_seniority_level because the values have a natural order, allowing the logistic regression model to capture progression effects efficiently without excessive feature expansion.
Topics
Community Discussion
No community discussion yet for this question.