Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.
exam questions

Exam Certified Data Engineer Professional All Questions

View all questions & answers for the Certified Data Engineer Professional exam

Exam Certified Data Engineer Professional topic 1 question 125 discussion

Actual exam question from Databricks's Certified Data Engineer Professional
Question #: 125
Topic #: 1
[All Certified Data Engineer Professional Questions]

The 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"?

  • A. df.map(lambda x:model(x[columns])).select("customer_id, predictions")
  • B. df.select("customer_id",
    model(*columns).alias("predictions"))
  • C. model.predict(df, columns)
  • D. df.apply(model, columns).select("customer_id, predictions")
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
Hadiler
4 months ago
Selected Answer: B
B is the correct answer
upvoted 1 times
...
vexor3
4 months, 1 week ago
Selected Answer: B
B is correct
upvoted 1 times
...
Freyr
5 months, 3 weeks ago
Selected Answer: B
Correct Answer: B This option uses select to specify columns from the DataFrame and applies the model to the specified columns (columns). The output of the model is aliased as "predictions", which ensures the output DataFrame will have the column names "customer_id" and "predictions" with appropriate data types assuming the model returns a double type. This syntax aligns with PySpark's DataFrame transformations and is a typical way to apply a machine learning model to specific columns in Databricks.
upvoted 3 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...