QuestionQ157

VerifiedUsing Spark ML

A Machine Learning Engineer has a large dataset containing a customer_region column and needs to train distinct models for each region, then produce predictions. They must parallelize this group-specific model-training process by using Databricks and the Pandas Function API.

Which approach implements this solution?

Explanation

groupBy("customer_region").applyInPandas() applies the pandas training-and-prediction function independently to each logical customer-region group. This supports separate per-region models while Spark distributes the grouped processing across the cluster.

Community Discussion

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