labpg3.ipynb - Colab
labpg3.ipynb - Colab
import pandas as pd
from sklearn.model_selection import train_test_split
#Import train teat aplit function
#load dataset
data=pd.read_csv(r"/content/drive/MyDrive/Jupyter/dataset3.csv")
print (data)
#split dataset in features and target variable
X=data.iloc[:,1:9]
Y=data.iloc[:,-1]
#Split dataset into training set and test set
X_train, X_test, y_train, y_test =train_test_split(X, Y, test_size= 0.3, random_state=1) # 70% training and 30% test
print("The training data for X is \n\n", X_train)
print("The training data for Y is \n\n",y_train)
Label
0 1
1 0
2 1
3 0
4 1
5 0
6 1
7 0
8 1
9 1
10 0
11 1
12 0
13 1
14 1
The training data for X is
4 1
1 0
13 1
0 1
14 1
9 1
8 1
12 0
11 1
5 0