Exam Certified Machine Learning Professional All QuestionsBrowse all questions from this 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?

    Correct Answer: B

    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
GVR76Option: B

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.

hugodscarvalhoOption: B

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.

mozucaOption: E

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

akssha74

Any questions so far from this guide?

BokNinjaOption: B

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.