Skip to content

Instantly share code, notes, and snippets.

@amankharwal
Created October 8, 2020 11:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amankharwal/b7d8eb295778f7bbac2c200a78203e68 to your computer and use it in GitHub Desktop.
Save amankharwal/b7d8eb295778f7bbac2c200a78203e68 to your computer and use it in GitHub Desktop.
#split dataset into features and target variable
feature_cols = list(df.columns)[2:]
X = df[feature_cols] # Features
y = df[['language']] # Target variable
# Split dataset into training set and test set
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2) # 80% train and 20% test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment