
Ultimate access to all questions.
In the context of Spark ML, explain the process of splitting data using Spark ML and identify the key gotchas that one might encounter during this process. Provide a code snippet demonstrating the correct way to split data and explain how to handle the potential issues that may arise.
A
Use the train_test_split function from the sklearn.model_selection module to split the data._
B
Use the randomSplit method from the Spark DataFrame API to split the data, ensuring that the seed is set for reproducibility.
C
Use the split method from the Spark DataFrame API to split the data, but be aware of the potential for data leakage.
D
Use the randomSplitWithWeights method from the Spark DataFrame API to split the data, taking into account the class weights for imbalanced datasets.