Databricks Certified Machine Learning Professional — Question 23
A data scientist has developed a scikit-learn random forest model model, but they have not yet logged model with MLflow. They want to obtain the input schema and the output schema of the model so they can document what type of data is expected as input.
Which of the following MLflow operations can be used to perform this task?
Answer options
- A. mlflow.models.schema.infer_schema
- B. mlflow.models.signature.infer_signature
- C. mlflow.models.Model.get_input_schema
- D. mlflow.models.Model.signature
- E. There is no way to obtain the input schema and the output schema of an unlogged model.
Correct answer: B
Explanation
The correct answer is B because mlflow.models.signature.infer_signature is specifically designed to infer the input and output schemas of a model, even if it has not been logged yet. The other options either do not exist or are not applicable for retrieving schemas of unlogged models.