Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pandas as pd
- from sklearn.model_selection import train_test_split
- # reading featuers of dataset
- f=open('/content/spike_counts.txt', 'r')
- lst0=[]
- for i in f:
- lst1=[int(j) for j in i.split(' ')]
- lst0.append(lst1)
- df0=pd.DataFrame(lst0)
- print(df0.shape)
- #reading labels of dataset
- df1=pd.read_table('/content/location_areas.txt',header=None)
- print(df1.shape)
- #splitting the dataset into 80%-20% train-test segments
- X_train,X_test,y_train,y_test=train_test_split(df0,df1,train_size=0.8,random_state=0)
- print(X_train.shape)
- print(X_test.shape)
- print(y_train.shape)
- print(y_test.shape)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement