Skip to content

Instantly share code, notes, and snippets.

@malharb
Created June 5, 2020 08:07
Show Gist options
  • Save malharb/e91492bb88dedf5b260d86c473928b6b to your computer and use it in GitHub Desktop.
Save malharb/e91492bb88dedf5b260d86c473928b6b to your computer and use it in GitHub Desktop.
Pulsar - splitting data and preprocessing
from sklearn.model_selection import train_test_split
X = df.drop('target_class',axis=1)
y = df['target_class']
X_train,X_test,y_train,y_test = train_test_split(X,y,test_size=0.3)
from sklearn.preprocessing import MinMaxScaler
scaler = MinMaxScaler()
scaler.fit(X_train)
X_train = scaler.transform(X_train)
X_test = scaler.transform(X_test)
y_train = y_train.values
y_test = y_test.values
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment