QuestionQ130

VerifiedModel Development

A data scientist has created a machine learning pipeline using Spark ML with a static input data set, but the pipeline takes too long to process. They increase the number of cluster workers so that the pipeline runs more efficiently. After reconfiguring the cluster, they observe that the number of rows in the training set differs from the number of rows in the training set before the reconfiguration.

Which approach will guarantee a reproducible training and test set for every model?

Explanation

Persisting the already-generated training and test data sets preserves the exact records assigned to each split. Subsequent model runs can reload those materialized splits, so changes to cluster size or Spark partitioning cannot alter training/test membership. Spark's randomSplit accepts a seed for sampling, but saving the split outputs is the direct guarantee that the same data sets are reused.

Learn more

Community Discussion

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