Skip to content

Instantly share code, notes, and snippets.

@PhilipPurwoko
Created September 12, 2020 04:42
Show Gist options
  • Save PhilipPurwoko/61336f592a7a8d092ca975666e3dce6f to your computer and use it in GitHub Desktop.
Save PhilipPurwoko/61336f592a7a8d092ca975666e3dce6f to your computer and use it in GitHub Desktop.
# Memisahkan dataframe awal menjadi data dan label
data = dataframe_int.drop('Drug',axis=1)
label = dataframe_int['Drug']
# Memisahkan dataframe menjadi data latihan dan data tes
from sklearn.model_selection import train_test_split
x_train, x_test, y_train, y_test = train_test_split(data,label,test_size=0.2)
# Print dataframe.shape untuk mengetahui bentuk dataframe
print(x_train.shape,y_train.shape)
print(x_test.shape,y_test.shape)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment