QuestionQ241

VerifiedDebugging and Deploying

The data science team has created and logged a production model with MLflow. The model takes a list of column names and returns a new column of type DOUBLE.

The following code correctly imports the production model, loads the customers table—which contains the customer_id key column—into a DataFrame, and defines the feature columns required by the model.

Question Image

Which code block will produce a DataFrame with the schema customer_id LONG, predictions DOUBLE?

Explanation

mlflow.pyfunc.spark_udf creates a callable Spark UDF. Calling it with the feature columns as separate arguments applies the model row by row; aliasing its DOUBLE result as predictions and selecting customer_id produces customer_id LONG, predictions DOUBLE.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!