Databricks Machine Learning Associate exam dumps

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

Select 4

You have trained a machine learning model to predict house prices and saved it as model.pkl. Your task is to use pandas for batch inference on a new dataset new_data.csv, which contains features but no target values. Which of the following steps are required to perform batch inference using pandas in this scenario?

  1. A

    Load the pre-trained model using a library like joblib or pickle.

  2. B

    Load the new dataset using pandas and preprocess it to match the training data format.

  3. C

    Directly call the predict method on the pandas DataFrame without further preparation.

  4. D

    Convert the pandas DataFrame to a NumPy array or similar format before passing it to the model's predict method.

  5. E

    Save the prediction results back to a pandas DataFrame or CSV file for further analysis.

Show answer and explanation

Correct answers: A, B, D, E

Explanation

To perform batch inference using pandas, you need to load the pre-trained model and the new dataset, preprocess the dataset to match the training data format, and convert the DataFrame to a compatible format (like a NumPy array) before passing it to the model's predict method. Finally, the predictions should be saved back to a pandas DataFrame or a CSV file for further analysis. Directly using the DataFrame without conversion would result in an error in most cases.

  • A. Correct.

    Correct. The pre-trained model must be loaded using joblib or pickle to perform inference.

  • B. Correct.

    Correct. The new dataset must be loaded and preprocessed to match the format used during model training.

  • C. Incorrect.

    Incorrect. A pandas DataFrame cannot always directly be passed to the model's predict method; it often requires conversion to a NumPy array or similar format.

  • D. Correct.

    Correct. Most machine learning models require the input data to be in a NumPy array or similar format for predictions.

  • E. Correct.

    Correct. After generating predictions, saving them back to a pandas DataFrame or CSV file is a crucial step to make the results accessible for further use.

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