Databricks Machine Learning Associate exam dumps

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

Select 4

You have trained a machine learning model in Databricks and saved it as a serialized .pkl file. Now, you want to perform batch inference on a large CSV file containing new data using pandas. Which of the following steps are necessary to correctly perform batch inference?

  1. A

    Load the new data into a pandas DataFrame.

  2. B

    Deserialize the model using pandas' built-in read_pickle() method.

  3. C

    Apply the model's predict() method to the DataFrame.

  4. D

    Save the inference results to a new CSV file using pandas' to_csv() method.

  5. E

    Ensure the input data's feature columns match the model's training feature columns before inference.

Show answer and explanation

Correct answers: A, C, D, E

Explanation

To perform batch inference with pandas, you first load the new data into a pandas DataFrame. Then, you need to deserialize the model using a library like pickle or joblib (not pandas' read_pickle()). Afterward, use the model's predict() method on the DataFrame to generate predictions. Finally, ensure the input columns match the training features, and save the predictions to a file using pandas' to_csv() for further use. This process ensures accurate and functional batch inference.

  • A. Correct.

    Correct: Loading the new data into a pandas DataFrame is the first step to prepare it for batch inference.

  • B. Incorrect.

    Incorrect: While pandas has a read_pickle() method, it is not typically used to load machine learning models. Instead, libraries like joblib or pickle are used for model deserialization.

  • C. Correct.

    Correct: The predict() method of the deserialized model is used to generate predictions for the input data.

  • D. Correct.

    Correct: Saving the inference results to a CSV file using to_csv() is a common step to persist the batch inference results.

  • E. Correct.

    Correct: Ensuring the feature columns match is critical because the model expects the same input structure it was trained on.

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