Created
September 17, 2019 21:51
-
-
Save YiChengRepo/c5990cb64d73a7ab2b950b9bbf4f343b to your computer and use it in GitHub Desktop.
train_test_split
This file contains hidden or 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
# -*- coding: utf-8 -*- | |
from sklearn.model_selection import train_test_split | |
import pandas as pd | |
import numpy as np | |
filepath="C:\\Saved_data.csv" | |
data = pd.read_csv(filepath, sep=',',header=None) | |
X = data.iloc[:,0:5].values | |
y = data.iloc[:,5].values | |
x_train, x_test, y_train, y_test = train_test_split(X, y, train_size=.7, random_state = 100) | |
print("x_train boyutu =" +str(np.shape(x_train))) | |
print("x_test boyutu =" +str(np.shape(x_test))) | |
print("y_train boyutu =" +str(np.shape(y_train))) | |
print("y_test boyutu =" +str(np.shape(y_test))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment