Skip to content

Instantly share code, notes, and snippets.

@woobe
Created September 11, 2018 18:25
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save woobe/bd79d9f4d7ea139c5d2eb4cf1de1e7db to your computer and use it in GitHub Desktop.
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