Skip to content

Instantly share code, notes, and snippets.

@JarrydWannenburg
Created August 26, 2022 19:35
Show Gist options
  • Save JarrydWannenburg/5d91e41a57179081f68c084d90613e93 to your computer and use it in GitHub Desktop.
Save JarrydWannenburg/5d91e41a57179081f68c084d90613e93 to your computer and use it in GitHub Desktop.
Scalable_Pipeline_Article
X,y = df.drop(columns=['Transported']), df.loc[:, ['Transported']] #Target Variable
# Replacing the predicted true/false from a string to a boolean
y.replace({True:'True', False:'False'}, inplace=True)
X_train, X_test, y_train, y_test = train_test_split(X,y, test_size=0.33)
# Using ravel to silence a user warning. No big deal though. Doesn't change anything.
full_pipe.fit(X_train, y_train.values.ravel());
y_pred = full_pipe.predict(X_test)
from sklearn.metrics import accuracy_score # Should have been in libraries but oops
# Get about 76-78% which isn't too bad considering I chose SVC without any reason (just for the demo)
accuracy_score(y_test, y_pred)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment