Created
November 15, 2020 23:49
-
-
Save tiaplagata/b5853ea032168066a73992a030e96083 to your computer and use it in GitHub Desktop.
Basic Pipeline Abilities
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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