Skip to content

Instantly share code, notes, and snippets.

@kaysush
Created May 16, 2018 15:19
Show Gist options
  • Save kaysush/c6e72501b0be755b4ed475b4c63ad6a0 to your computer and use it in GitHub Desktop.
Save kaysush/c6e72501b0be755b4ed475b4c63ad6a0 to your computer and use it in GitHub Desktop.
Splitting dataset into training and Test set
val splits = df.randomSplit(Array(0.8, 0.2), seed = 1234L)
val train = splits(0)
val test = splits(1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment