Created
September 11, 2018 18:25
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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