Skip to content

Instantly share code, notes, and snippets.

@CLozy
Created October 19, 2021 17:58
Show Gist options
  • Save CLozy/4ae7c9d6f517de7adec49e052512bb21 to your computer and use it in GitHub Desktop.
Save CLozy/4ae7c9d6f517de7adec49e052512bb21 to your computer and use it in GitHub Desktop.
spilliting dataset to train and test set
#splitting the dataset.csv file into train , test splits and saving them as csv files
from sklearn.model_selection import train_test_split
dataset_df = pd.read_csv(r'/content/gdrive/My Drive/Malaria/dataset.csv')
train,test = train_test_split(dataset_df, test_size=0.1)
train.to_csv(r'gdrive/My Drive/Malaria/train.csv', index=False)
test.to_csv(r'gdrive/My Drive/Malaria/test.csv', index=False)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment