Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test/Train/Val split #5

Open
DrJonnyT opened this issue Aug 10, 2023 · 0 comments
Open

Test/Train/Val split #5

DrJonnyT opened this issue Aug 10, 2023 · 0 comments

Comments

@DrJonnyT
Copy link
Collaborator

dataset_train, dataset_temp, labels_train, labels_temp = train_test_split(dataset, labels, test_size=0.3, stratify=labels, random_state=42)
dataset_val, dataset_test, labels_val, labels_test = train_test_split(dataset_temp, labels_temp, test_size=0.5, stratify=labels_temp, random_state=42)

This makes it a 70:15:15 split. Also stratifies so you get a good mix of labels

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant