Certified Machine Learning Professional Exam QuestionsBrowse all questions from this exam

Certified Machine Learning Professional Exam - Question 22


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?

Show Answer
Correct Answer: BE

To obtain the input schema and the output schema of a scikit-learn random forest model that has not yet been logged with MLflow, you should use the mlflow.models.signature.infer_signature function. This function can be used to infer the input and output schemas from the model’s training data and optionally the model’s labels, returning a ModelSignature object that contains the necessary schema information.

Discussion

5 comments
Sign in to comment
GVR76Option: B
Dec 31, 2023

The correct answer is B. mlflow.models.signature.infer_signature. Here's why the other options are incorrect: A. mlflow.models.schema.infer_schema: This function is for inferring schema from data, not from models. C. mlflow.models.Model.get_input_schema: This method only works for models that have already been logged with MLflow. D. mlflow.models.Model.signature: This method also requires a logged model to access the signature. E. There is no way to obtain the input schema and the output schema of an unlogged model: This is incorrect; mlflow.models.signature.infer_signature can be used for unlogged models.

BokNinjaOption: B
Dec 19, 2023

The correct answer is B. mlflow.models.signature.infer_signature. The mlflow.models.signature.infer_signature function can be used to infer an MLflow model signature, which includes the input schema and the output schema of the model. This function takes as input the model’s training data (or a sample of it) and optionally the model’s labels, and returns a ModelSignature object that contains the input and output schema of the model.

akssha74
Dec 25, 2023

Any questions so far from this guide?

mozucaOption: E
Dec 29, 2023

I think it is: There is no way to obtain the input schema and the output schema of an unlogged model

hugodscarvalhoOption: B
Jan 27, 2024

The correct import statement would be: 'from mlflow.models import infer_signature.' I'm choosing B since it contains the actual method name infer_signature.