Skip to content

Instantly share code, notes, and snippets.

@AyishaR
Created April 18, 2021 18:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AyishaR/06e4e79db15388cb67411e1a4b38bf24 to your computer and use it in GitHub Desktop.
Save AyishaR/06e4e79db15388cb67411e1a4b38bf24 to your computer and use it in GitHub Desktop.
# Splitting into train, val and test set -- 80-10-10 split
# First, an 80-20 split
Xtrain, Xvaltest, ytrain, yvaltest = train_test_split(X, y, test_size = 0.2)
# Then split the 20% into half
Xval, Xtest, yval, ytest = train_test_split(Xvaltest, yvaltest, test_size = 0.5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment