Databricks Machine Learning Associate exam dumps

Databricks Machine Learning Associate practice question 532 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 532

Select 2

In which of the following scenarios would one-hot encoding be appropriate for preparing a dataset for a machine learning model?

  1. A

    A dataset contains a 'City' column with categorical values like 'New York', 'San Francisco', and 'Chicago', and a linear regression model will be applied.

  2. B

    A dataset contains a 'Temperature' column with continuous numerical values, and a decision tree model will be applied.

  3. C

    A dataset contains a 'Product Category' column with 10 unique categorical values, and a logistic regression model will be applied.

  4. D

    A dataset contains a 'Customer Age' column with discrete numerical values, and a clustering algorithm will be applied.

Show answer and explanation

Correct answers: A, C

Explanation

One-hot encoding is useful for converting categorical variables into a numerical format that machine learning models can interpret. It is appropriate for columns with categorical data, such as 'City' or 'Product Category', but not for continuous or discrete numerical variables.

  • A. Correct.

    One-hot encoding is appropriate here because the 'City' column is categorical, and linear regression cannot interpret categorical data directly. One-hot encoding converts the categorical values into a format suitable for the model.

  • B. Incorrect.

    One-hot encoding is not appropriate for continuous numerical data like 'Temperature', as it is already in a format suitable for machine learning models.

  • C. Correct.

    One-hot encoding is appropriate here because the 'Product Category' column is categorical, and logistic regression requires categorical variables to be converted into numerical representations.

  • D. Incorrect.

    One-hot encoding is not appropriate for discrete numerical data like 'Customer Age'. Discrete numerical data should either be left as-is or scaled, depending on the model being used.

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