QuestionQ10

VerifiedModel Development

Which Spark operation can randomly divide a Spark DataFrame into a training DataFrame and a test DataFrame for downstream use?

Explanation

DataFrame.randomSplit randomly partitions a DataFrame according to supplied weights and returns the resulting DataFrames. It can therefore produce separate training and test datasets, optionally using a seed for reproducibility.

Learn more

Community Discussion

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