Instantly share code, notes, and snippets.

Embed
What would you like to do?
A simple script to split airline sentiment dataset into train and test set
import numpy as np
import pandas as pd
from sklearn import model_selection
al = pd.read_csv("Airline-Sentiment-2-w-AA.csv", encoding='ISO-8859-1')
train_al, test_al = model_selection.train_test_split(al, test_size=0.2, random_state=2018)
train_al.to_csv("train_airline_sentiment.csv", index=False)
test_al.to_csv("test_airline_sentiment.csv", index=False)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment