Databricks Machine Learning Associate exam dumps

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

Select 4

You have trained a machine learning model in Databricks and saved it as a .pkl file. You now want to perform batch inference on a new dataset stored as a CSV file using pandas in a Databricks notebook. Which of the following steps are required to correctly perform batch inference in this scenario?

  1. A

    Load the new dataset using pandas' read_csv method.

  2. B

    Load the trained model using the pickle.load function.

  3. C

    Use the model.predict method on the entire pandas DataFrame without any preprocessing.

  4. D

    Ensure the feature columns in the new dataset match those used during training.

  5. E

    Save the inference results back to the Databricks file system using pandas' to_csv method.

Show answer and explanation

Correct answers: A, B, D, E

Explanation

Performing batch inference with pandas in Databricks involves loading the new dataset, ensuring it is preprocessed to match the training dataset's feature structure, loading the trained model, applying the model's predict method, and finally saving the results. Skipping preprocessing could lead to errors or inaccurate predictions, which is why preprocessing must be considered carefully.

  • A. Correct.

    Correct: The new dataset must be loaded into a pandas DataFrame using read_csv before performing batch inference.

  • B. Correct.

    Correct: The trained model, saved as a .pkl file, needs to be loaded using pickle.load to use it for inference.

  • C. Incorrect.

    Incorrect: The new dataset might require preprocessing (e.g., scaling, encoding) to match the format expected by the model. Simply calling model.predict without preprocessing can lead to errors.

  • D. Correct.

    Correct: The feature columns in the new dataset must match the structure and order of the dataset used during training to ensure accurate predictions.

  • E. Correct.

    Correct: After performing batch inference, saving the results back to the Databricks file system using pandas' to_csv is a common step for further analysis or sharing.

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