Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # 6. Gradient Boosting
- # What it does: Builds one model at a time, each one trying to correct the previous one's mistakes.
- # Use Case: Customer churn prediction, click-through rate optimization.
- from sklearn.ensemble import GradientBoostingClassifier
- gb = GradientBoostingClassifier(n_estimators=100, random_state=42)
- gb.fit(X_train, y_train)
- y_pred = gb.predict(X_test)
- print("Gradient Boosting Confusion Matrix:\n", confusion_matrix(y_test, y_pred))
- print("\nGradient Boosting Classification Report:\n", classification_report(y_test, y_pred))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement