You have a dataset with multiple groups, and you want to train and apply group-specific models using the Pandas Function API in Spark. Provide a detailed explanation of how you would approach this task, including the steps involved and any considerations to keep in mind.