Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from sklearn.ensemble import GradientBoostingClassifier
- # Create Gradient Boosting model
- boosting_model = GradientBoostingClassifier(n_estimators=100, random_state=42)
- # Train the model
- boosting_model.fit(X_train, y_train) # Note: No scaling needed for trees
- # Predict
- y_pred_boosting = boosting_model.predict(X_test)
- # Evaluate
- print("Gradient Boosting")
- print("Accuracy:", accuracy_score(y_test, y_pred_boosting))
- print(confusion_matrix(y_test, y_pred_boosting))
- print(classification_report(y_test, y_pred_boosting))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement