Databricks Certified Machine Learning Associate Practice Questions

Databricks Certified Machine Learning Associate exam preparation

Databricks Certified Machine Learning Associate practice questions in English: 170 questions with explanations. The mock exam has 48 questions and 90 minutes.

Databricks Certified Machine Learning Associate free question 7 / 10 · Domain 3: Model Development

A data scientist builds a model with Spark MLlib (spark.ml) that sorts support requests into one of five categories. The labels have been turned into the numbers 0 to 4 with StringIndexer. They want to use an ensemble of decision trees in a single estimator. Which should they choose?

  1. FMClassifier, trained on the five-valued labels 0 to 4 as they are
  2. GBTClassifier, trained on the five-valued labels 0 to 4 as they are
  3. RandomForestClassifier, trained on the five-valued labels 0 to 4 as they are
  4. LinearSVC, trained on the five-valued labels 0 to 4 as they are
Show the answer and explanation

Answer: C

Why this is correct
Random forests in spark.ml are a family of classification and regression methods that combine many decision trees to reduce the risk of overfitting, and they handle both continuous and categorical features. Gradient-boosted trees are also tree ensembles, but the documentation states that GBTClassifier currently only supports binary labels. To train five classes in a single tree-ensemble estimator, RandomForestClassifier is the choice.

Why the other options are wrong
"GBTClassifier, trained on the five-valued labels 0 to 4 as they are" … The documentation notes that GBTClassifier currently only supports binary labels, so passing five-valued labels does not give a multiclass model.
"FMClassifier, trained on the five-valued labels 0 to 4 as they are" … Factorization machines in spark.ml can be used for regression and, through a sigmoid function, for binary classification. FMClassifier cannot split five categories in one model, and it is not a tree ensemble.
"LinearSVC, trained on the five-valued labels 0 to 4 as they are" … LinearSVC supports binary classification with a linear support vector machine, and it is not a tree ensemble. It cannot take five-valued labels as they are.

Key point
A single decision tree (DecisionTreeClassifier) also handles binary and multiclass classification and needs no feature scaling. spark.ml tree estimators tell continuous from categorical features through the metadata of the DataFrame, so indexing a column with StringIndexer or VectorIndexer makes it be treated as categorical.

Go to the Databricks Certified Machine Learning Associate practice app (10 free questions; purchase unlocks all questions)

See the full practice set