Task: Stratified Train-Test Split Based on a Categorical Column
Task: Stratified Train-Test Split Based on a Categorical Column: a task in Terminal-Lego-15k (Harbor dataset). Write a Python script that performs a stratified 80-20 train-test split on a CSV dataset, ensuring that the split proportionally represents all values in the Categories column. Both the…
The task
Write a Python script that performs a stratified 80-20 train-test split on a CSV dataset, ensuring that the split proportionally represents all values in the `Categories` column. Both the training and test sets should maintain the same distribution of categories as the original dataset.
Part of PrimeIntellect/Terminal-Lego-15k.