Skip to content

Instantly share code, notes, and snippets.

@tiaplagata
Created November 15, 2020 23:49
Show Gist options
  • Save tiaplagata/b5853ea032168066a73992a030e96083 to your computer and use it in GitHub Desktop.
Save tiaplagata/b5853ea032168066a73992a030e96083 to your computer and use it in GitHub Desktop.
Basic Pipeline Abilities
# First fit the pipeline to your training data, like you would with an estimator
basic_pipe.fit(X_train, y_train)
# Next you can reference the pipeline object in the same way as an estimator
score = basic_pipe.score(X_test, y_test)
test_preds = basic_pipe.predict(X_test)
# You can even reference your feature importances for certain types of estimators
# To do this, index the estimator step, and the method within the tuple to access all the RandomForestClassifier attributes
basic_pipe[1][1].feature_importances_
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment