nerdexam
Amazon

MLA-C01 · Question #180

A company's ML engineer is creating a classification model. The ML engineer explores the dataset and notices a column that is named day_of_week. The column's data consists of the following values…

The correct answer is C. One-hot encoding. One-hot encoding is the correct technique for converting nominal categorical data-like days of the week-into binary values. It creates a separate binary column for each unique category (e.g., Is_Monday, Is_Tuesday, etc.), with a value of 1 if the row matches that category and 0…

Data Preparation for Machine Learning

Question

A company’s ML engineer is creating a classification model. The ML engineer explores the dataset and notices a column that is named day_of_week. The column’s data consists of the following values: Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, and Sunday. Which technique should the ML engineer use to convert this column’s data to binary values?

Options

  • ABinary encoding
  • BLabel encoding
  • COne-hot encoding
  • DTokenization

How the community answered

(33 responses)
  • A
    6% (2)
  • B
    3% (1)
  • C
    88% (29)
  • D
    3% (1)

Explanation

One-hot encoding is the correct technique for converting nominal categorical data-like days of the week-into binary values. It creates a separate binary column for each unique category (e.g., Is_Monday, Is_Tuesday, etc.), with a value of 1 if the row matches that category and 0 otherwise. This is ideal here because the days of the week have no inherent ordinal relationship; Monday is not 'less than' Tuesday in any meaningful numeric sense. Label encoding (B) would assign integers (0–6), implying a false ordinal order. Binary encoding (A) compresses categories into fewer binary columns but is typically used when there are many categories. Tokenization (D) is a natural language processing technique for splitting text into tokens, not applicable here.

Topics

#Categorical Data Encoding#One-Hot Encoding#Data Preprocessing#Feature Engineering

Community Discussion

No community discussion yet for this question.

Full MLA-C01 Practice