Free Databricks Machine Learning Associate Actual Exam Questions - Question 4 Discussion

Question No. 4
A machine learning engineer wants to parallelize the inference of group-specific models using the
Pandas Function API. They have developed the apply_model function that will look up and load the
correct model for each group, and they want to apply it to each group of DataFrame df.
They have written the following incomplete code block:
Machine Learning Associate practice exam questions
Which piece of code can be used to fill in the above blank to complete the task?
Select one option, then reveal solution.
US
OF
Osama F.
2026-02-16

Maybe C makes sense because mapInPandas lets you transform each group by applying a function and returning a DataFrame, which fits loading and applying group-specific models smoothly.

0
OF
Osama F.
2026-01-30

Maybe A makes the most sense since applyInPandas is meant for grouping operations like this. The others don’t seem like valid Pandas Function API methods for group-level work.

0
OF
Osama F.
2026-01-29

It’s A. applyInPandas is designed for applying a function to grouped dataframes, which fits the use case of group-specific model inference. Options B and C don’t exist or aren’t standard Pandas APIs, and D (predict) isn’t a method for applying functions on grouped DataFrames. apply_model likely returns DataFrames since it processes groups individually, making applyInPandas the correct choice here.

0
AG
Arjun G.
2026-01-24

C imo, mapInPandas is usually for element-wise or row-wise mapping, so it might not fit group-specific model loading. applyInPandas makes more sense for group-level processing here.

0
AG
Arjun G.
2026-01-16

Maybe A, but does the function return a DataFrame? Need that detail.

0