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 5 / 10 · Domain 2: Data Processing

A team that uses Python, Scala, R and SQL notebooks wants to produce summary statistics of features with dbutils.data.summarize. Which combination of DataFrame types it accepts and languages it can be called from is correct?

  1. It accepts Spark DataFrames, and it can be called from Python, Scala and R
  2. It accepts Spark DataFrames, and it can be called from Python and SQL
  3. It accepts Spark and pandas DataFrames, and it can be called from Python and SQL
  4. It accepts Spark and pandas DataFrames, and it can be called from Python, Scala and R
Show the answer and explanation

Answer: D

Why this is correct
The dbutils reference describes the summarize command as calculating and displaying summary statistics of an Apache Spark DataFrame or pandas DataFrame, and says it is available for Python, Scala and R. It belongs to the data utility, dbutils.data, available in Databricks Runtime 9.0 and above. The page also warns that the command analyzes the complete contents of the DataFrame, so running it on very large DataFrames can be very expensive.

Why the other options are wrong
"It accepts Spark DataFrames, and it can be called from Python, Scala and R" … A pandas DataFrame is accepted as well as a Spark DataFrame. A small dataset loaded with pandas can be summarized without converting it first.
"It accepts Spark and pandas DataFrames, and it can be called from Python and SQL" … The supported languages are Python, Scala and R. SQL is not listed, so a SQL-focused team member has to call the command from a Python cell.
"It accepts Spark DataFrames, and it can be called from Python and SQL" … Spark DataFrames are accepted, but SQL is not a supported language and pandas DataFrames are accepted too. The command cannot be run from a SQL cell.

Key point
A similar summary can be produced without code from the + > Data Profile option on the result table of display(df). dbutils.data.summarize is the code route, which suits places where nobody clicks through the interface, such as a job.

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

See the full practice set