Skip to content

Instantly share code, notes, and snippets.

@zero731
Created March 11, 2021 00:30
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 zero731/e1b96e64511991295b8dcfd502abb7d2 to your computer and use it in GitHub Desktop.
Save zero731/e1b96e64511991295b8dcfd502abb7d2 to your computer and use it in GitHub Desktop.
fit and evaluate random forest classifier for example churn analysis
## Instantiate random forest classifier
rf = RandomForestClassifier(random_state=random_seed,
n_jobs=-1)
## Fit random forest classifier to training data
rf.fit(X_train_tf, y_train)
## Evaluate how the model performs on the test set
eval_clf(rf, X_test_tf, y_test);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment