You have a dataset with a categorical Day_Of_Week field and you need to convert it into binary indicator variables for use by a machine learning model. Which technique should you use?
Choose an answer
Tap an option to check your answer.
Correct answer: One-hot encoding.
Why this is the answer
One-hot encoding is the correct technique because it converts categorical variables into a numerical format suitable for machine learning models. For each unique category in 'DayOfWeek' (e.g., Monday, Tuesday), it creates a new binary column, where a '1' indicates the presence of that day and a '0' indicates its absence. This avoids implying an ordinal relationship between days, which would be incorrect. Binarization converts numerical features into binary (0 or 1) based on a threshold, which is not applicable here as 'DayOfWeek' is categorical. Tokenization breaks down text into smaller units (tokens) and is used for natural language processing, not for converting categorical variables. Normalization transformation scales numerical features to a standard range, which is also not relevant for categorical data.
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