Certified Machine Learning Associate Practice Test

Certified Machine Learning Associate Practice Test practice questions, page 4 of 6, with answer review and explanations.

Question 16

Which of the following describes the relationship between native Spark DataFrames and pandas API on Spark DataFrames?

  1. pandas API on Spark DataFrames are single-node versions of Spark DataFrames with additional metadata
  2. pandas API on Spark DataFrames are more performant than Spark DataFrames
  3. pandas API on Spark DataFrames are made up of Spark DataFrames and additional metadata
  4. pandas API on Spark DataFrames are less mutable versions of Spark DataFrames
  5. pandas API on Spark DataFrames are unrelated to Spark DataFrames

Question 17

A data scientist has written a data cleaning notebook that utilizes the pandas library, but their colleague has suggested that they refactor their notebook to scale with big data. Which of the following approaches can the data scientist take to spend the least amount of time refactoring their notebook to scale with big data?

  1. They can refactor their notebook to process the data in parallel.
  2. They can refactor their notebook to use the PySpark DataFrame API.
  3. They can refactor their notebook to use the Scala Dataset API.
  4. They can refactor their notebook to use Spark SQL.
  5. They can refactor their notebook to utilize the pandas API on Spark.

Question 18

A data scientist has defined a Pandas UDF function predict to parallelize the inference process for a single-node model: They have written the following incomplete code block to use predict to score each record of Spark DataFrame spark_df: Which of the following lines of code can be used to complete the code block to successfully complete the task?

  1. predict(*spark_df.columns)
  2. mapInPandas(predict)
  3. predict(Iterator(spark_df))
  4. mapInPandas(predict(spark_df.columns))
  5. predict(spark_df.columns)

Question 19

Which of the Spark operations can be used to randomly split a Spark DataFrame into a training DataFrame and a test DataFrame for downstream use?

  1. TrainValidationSplit
  2. DataFrame.where
  3. CrossValidator
  4. TrainValidationSplitModel
  5. DataFrame.randomSplit

Question 20

A data scientist is using Spark ML to engineer features for an exploratory machine learning project. They decide they want to standardize their features using the following code block: Upon code review, a colleague expressed concern with the features being standardized prior to splitting the data into a training set and a test set. Which of the following changes can the data scientist make to address the concern?

  1. Utilize the MinMaxScaler object to standardize the training data according to global minimum and maximum values
  2. Utilize the MinMaxScaler object to standardize the test data according to global minimum and maximum values
  3. Utilize a cross-validation process rather than a train-test split process to remove the need for standardizing data
  4. Utilize the Pipeline API to standardize the training data according to the test data's summary statistics
  5. Utilize the Pipeline API to standardize the test data according to the training data's summary statistics