Databricks certification · Exam Databricks-Machine-Learning-Associate

Databricks-Machine-Learning-Associate Mock Exam

Databricks Certified Machine Learning Associate Exam

Find out if you're ready for Databricks-Machine-Learning-Associate. Take the free timed mock exam and get your score in minutes, or study the free Databricks-Machine-Learning-Associate questions below with answers and explanations.

9 questions · 15 minutes · free, no sign-up

Free Databricks-Machine-Learning-Associate questions

1–9 of 9 free
Question 1 Choose 1
Which of the following machine learning algorithms typically uses bagging?
Show answerHide answer

Correct answer: C Random forest

Explanation

Explanation:

Random Forest is a machine learning algorithm that typically uses bagging (Bootstrap Aggregating). Bagging is a technique that involves training multiple base models (such as decision trees) on different subsets of the data and then combining their predictions to improve overall model performance. Each subset is created by randomly sampling with replacement from the original dataset. The Random Forest algorithm builds multiple decision trees and merges them to get a more accurate and stable prediction.

References:

Databricks documentation on Random Forest: Random Forest in Spark ML

Question 2 Choose 1
A data scientist has developed a machine learning pipeline with a static input data set using Spark ML, but the pipeline is taking too long to process. They increase the number of workers in the cluster to get the pipeline to run more efficiently. They notice that the number of rows in the training set after reconfiguring the cluster is different from the number of rows in the training set prior to reconfiguring the cluster. Which of the following approaches will guarantee a reproducible training and test set for each model?
Show answerHide answer

Correct answer: B Write out the split data sets to persistent storage

Explanation

Explanation:

To ensure reproducible training and test sets, writing the split data sets to persistent storage is a reliable approach. This allows you to consistently load the same training and test data for each model run, regardless of cluster reconfiguration or other changes in the environment.

Correct approach:

Split the data.

Write the split data to persistent storage (e.g., HDFS, S3).

Load the data from storage for each model training session.

train_df, test_df = spark_df.randomSplit([0.8,0.2], seed=42)

train_df.write.parquet("path/to/train_df.parquet") test_df.write.parquet("path/to/test_df.parquet")# Later, load the datatrain_df = spark.read.parquet("path/to/train_df.parquet") test_df = spark.read.parquet("path/to/test_df.parquet")

References:

Spark DataFrameWriter Documentation
Question 3 Choose 1
A data scientist is wanting to explore the Spark DataFrame spark_df. The data scientist wants visual histograms displaying the distribution of numeric features to be included in the exploration. Which of the following lines of code can the data scientist run to accomplish the task?
Show answerHide answer

Correct answer: E dbutils.data.summarize (spark_df)

Explanation

Explanation:

To display visual histograms and summaries of the numeric features in a Spark DataFrame, the Databricks utility functiondbutils.data.summarizecan be used. This function provides a comprehensive summary, including visual histograms.

Correct code:

dbutils.data.summarize(spark_df)

Other options likespark_df.describe()andspark_df.summary()provide textual statistical summaries but do not include visual histograms.

References:

Databricks Utilities Documentation
Question 4 Choose 1
A data scientist is using Spark SQL to import their data into a machine learning pipeline. Once the data is imported, the data scientist performs machine learning tasks using Spark ML. Which of the following compute tools is best suited for this use case?
Show answerHide answer

Correct answer: B Standard cluster

Explanation

Explanation:

For a data scientist using Spark SQL to import data and then performing machine learning tasks using Spark ML, the best-suited compute tool is a Standard cluster. A Standard cluster in Databricks provides the necessary resources and scalability to handle large datasets and perform distributed computing tasks efficiently, making it ideal for running Spark SQL and Spark ML operations.

References:

Databricks documentation on clusters: Clusters in Databricks
Question 5 Choose 1
A machine learning engineer has created a Feature Table new_table using Feature Store Client fs. When creating the table, they specified a metadata description with key information about the Feature Table. They now want to retrieve that metadata programmatically. Which of the following lines of code will return the metadata description?
Show answerHide answer

Correct answer: C fs.get_table("new_table").description

Explanation

Explanation:

To retrieve the metadata description of a feature table created using the Feature Store Client (referred here asfs), the correct method involves callingget_tableon thefsclient with the table name as an argument, followed by accessing thedescriptionattribute of the returned object. The code snippetfs.get_table("new_table").descriptioncorrectly achieves this by fetching the table object for "new_table" and then accessing its description attribute, where the metadata is stored. The other options do not correctly focus on retrieving the metadata description.

References:

Databricks Feature Store documentation (Accessing Feature Table Metadata).
Question 6 Choose 1
A machine learning engineering team has a Job with three successive tasks. Each task runs a single notebook. The team has been alerted that the Job has failed in its latest run. Which of the following approaches can the team use to identify which task is the cause of the failure?
Show answerHide answer

Correct answer: B Review the matrix view in the Job's runs

Explanation

Explanation:

To identify which task is causing the failure in the job, the team should review the matrix view in the Job's runs. The matrix view provides a clear and detailed overview of each task's status, allowing the team to quickly identify which task failed. This approach ismore efficient than running each notebook interactively, as it provides immediate insights into the job's execution flow and any issues that occurred during the run.

References:

Databricks documentation on Jobs: Jobs in Databricks

Question 7 Choose 1
A data scientist is performing hyperparameter tuning using an iterative optimization algorithm. Each evaluation of unique hyperparameter values is being trained on a single compute node. They are performing eight total evaluations across eight total compute nodes. While the accuracy of the model does vary over the eight evaluations, they notice there is no trend of improvement in the accuracy. The data scientist believes this is due to the parallelization of the tuning process. Which change could the data scientist make to improve their model accuracy over the course of their tuning process?
Show answerHide answer

Correct answer: C Change the iterative optimization algorithm used to facilitate the tuning process.

Explanation

Explanation:

The lack of improvement in model accuracy across evaluations suggests that the optimization algorithm might not be effectively exploring the hyperparameter space. Iterative optimization algorithms like Tree-structured Parzen Estimators (TPE) or Bayesian Optimization can adapt based on previous evaluations, guiding the search towards more promising regions of the hyperparameter space.

Changing the optimization algorithm can lead to better utilization of the information gathered during each evaluation, potentially improving the overall accuracy.

References:

Hyperparameter Optimization with Hyperopt
Question 8 Choose 1
Which of the following describes the relationship between native Spark DataFrames and pandas API on Spark DataFrames?
Show answerHide answer

Correct answer: C pandas API on Spark DataFrames are made up of Spark DataFrames and additional metadata

Explanation

Explanation:

Pandas API on Spark (previously known as Koalas) provides a pandas-like API on top of Apache Spark. It allows users to perform pandas operations on large datasets using Spark's distributed compute capabilities. Internally, it uses Spark DataFrames and adds metadata that facilitates handling operations in a pandas-like manner, ensuring compatibility and leveraging Spark's performance and scalability.

References

pandas API on Spark documentation:https://spark.apache.org/docs/latest/api/python/user_guide/pandas_on_spark/index.html
Question 9 Choose 1
A data scientist has created two linear regression models. The first model uses price as a label variable and the second model uses log(price) as a label variable. When evaluating the RMSE of each model bycomparing the label predictions to the actual price values, the data scientist notices that the RMSE for the second model is much larger than the RMSE of the first model. Which of the following possible explanations for this difference is invalid?
Show answerHide answer

Correct answer: E The RMSE is an invalid evaluation metric for regression problems

Explanation

Explanation:

The Root Mean Squared Error (RMSE) is a standard and widely used metric for evaluating the accuracy of regression models. The statement that it is invalid is incorrect. Here’s a breakdown of why the other statements are or are not valid:

Transformations and RMSE Calculation:If the model predictions were transformed (e.g., using log), they should be converted back to their original scale before calculating RMSE to ensure accuracy in the evaluation. Missteps in this conversion process can lead to misleading RMSE values.

Accuracy of Models:Without additional information, we can't definitively say which model is more accurate without considering their RMSE values properly scaled back to the original price scale. Appropriateness of RMSE:RMSE is entirely valid for regression problems as it provides a measure of how accurately a model predicts the outcome, expressed in the same units as the dependent variable.

References

"Applied Predictive Modeling" by Max Kuhn and Kjell Johnson (Springer, 2013), particularly the chapters discussing model evaluation metrics.

That's the last free question

You've seen the free 30% (9 of 30 questions). Full access unlocks every question and full-length Databricks-Machine-Learning-Associate mock exams (65 questions, 105 minutes), a different mock on every attempt.

Unlock full mock exam
Full mock exam

Sit the Databricks-Machine-Learning-Associate exam before exam day

Full-length mocks with the same number of questions and the same time limit as the real Databricks-Machine-Learning-Associate exam. Every attempt draws a new set of questions from the full bank, so you can keep going until you pass comfortably.

Get full Databricks-Machine-Learning-Associate mock exam
  • 65questions per mock
  • 105 mintime limit
  • 30questions in the bank
  • Newmock on every attempt