A community hospital stores the admitting ward as a text label with no natural rank, such as emergency, surgical, or maternity. A linear model needs numeric columns that mark which ward a patient came from without treating one ward as larger than another. Which encoding builds those columns?
Select an answer to reveal the explanation.
Short Explanation
Think of each ward as its own light switch, on or off, with no switch meaning a bigger ward. One-hot encoding gives every admitting ward a binary column so your linear model can mark membership without inventing rank. The trap is label encoding, which stuffs the names into integers and pretends one ward outranks another.
Full Explanation
One-hot encoding expands a nominal label into one binary column per category. For each stay, the column of the admitting ward is marked present and the other ward columns are marked absent, so the linear model can use ward membership without treating emergency, surgical, and maternity as points on a number line. That is the encoding the hospital asked for. Label encoding replaces each name with a single integer, which invents an order the wards do not have and lets one coefficient treat a higher code as a larger ward. Mean encoding collapses each ward to one outcome average, a single magnitude rather than a binary column per ward, and it borrows the target the model is supposed to learn. Min-max scaling only rescales a number that already exists; it does not turn ward names into columns at all. Exam caveat: a full set of one-hot columns plus an intercept sums to a constant, so a linear fit may drop one reference ward during estimation even though the encoding itself still defines a column per ward. Operational check: count the new columns and confirm there is one binary indicator for each ward, with values limited to present and absent.