Question 66 of 307
Single answerThe data science team has created and logged a production model using MLflow. The model accepts 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 containing the customer_id key column into a DataFrame, and defines the feature columns needed for the model.
Which code block will output a DataFrame with the schema "customer_id LONG, predictions DOUBLE"?
Which code block will output a DataFrame with the schema "customer_id LONG, predictions DOUBLE"?
Adf.map(lambda x:model(x[columns])).select("customer_id, predictions")
✓Bdf.select("customer_id", model(*columns).alias("predictions"))
Cmodel.predict(df, columns)
Ddf.select("customer_id", pandas_udf(model, columns).alias("predictions"))
Edf.apply(model, columns).select("customer_id, predictions")
✓
Correct Answer: B
df.select("customer_id", model(*columns).alias("predictions"))
▥
Explanation
The correct answer is highlighted above. Review the wording carefully, then use the next question to continue building your understanding of Google certification topics.