Databricks Machine Learning Associate exam dumps

Databricks Machine Learning Associate practice question 191 of 656

Databricks Certified Machine Learning Associate. Associate level, Databricks. Free question with the correct answer and a full explanation.

Databricks Machine Learning Associate Question 191

Single answer

You are working on a machine learning project in Databricks and need to preprocess a categorical feature 'Color' with values ['Red', 'Blue', 'Green', 'Red']. You decide to use one-hot encoding. Which of the following correctly describes the outcome of applying one-hot encoding to this feature?

  1. A

    The 'Color' feature will be replaced with three new features, one for each unique category ('Red', 'Blue', 'Green'), containing binary values (0 or 1).

  2. B

    The 'Color' feature will be replaced with a numeric column where categories are assigned unique integers (e.g., 'Red' becomes 1, 'Blue' becomes 2, 'Green' becomes 3).

  3. C

    The 'Color' feature will remain a single column, but its string values will be encoded as numerical values representing the frequency of each category in the dataset.

  4. D

    The 'Color' feature will remain unchanged, as one-hot encoding does not modify the original data.

Show answer and explanation

Correct answer: A

Explanation

One-hot encoding is a common preprocessing step for categorical features in machine learning. It transforms a categorical feature into multiple binary features, one for each unique category. This enables machine learning algorithms to interpret categorical data without falsely implying an ordinal relationship between categories.

  • A. Correct.

    Correct: One-hot encoding replaces a categorical feature with multiple binary columns, one for each unique category. The value is 1 if the row corresponds to that category and 0 otherwise.

  • B. Incorrect.

    Incorrect: This describes label encoding, not one-hot encoding. Label encoding assigns integer values to each unique category, but it does not create separate columns for each category.

  • C. Incorrect.

    Incorrect: This describes frequency encoding, which replaces category values with their occurrence counts or proportions in the dataset, and is not related to one-hot encoding.

  • D. Incorrect.

    Incorrect: One-hot encoding modifies the original data by creating new binary columns for each unique category, so the original feature does not remain unchanged.

Timed practice exam

Take a Databricks Machine Learning Associate practice test under exam conditions

48 questions in 90 minutes, drawn from this bank, with a score report and a per-question review when you finish.

Start timed exam