<jupyter_start><jupyter_text>Boosting<jupyter_code>import numpy as np
import pandas as pd
import matplotlib.pyplot as plt

from sklearn.linear_model import LogisticRegression
from sklearn.tree import DecisionTreeClassifier
from sklearn.model_selection import train_test_split
from sklearn.metrics import classification_report

import warnings
warnings.filterwarnings('ignore')
df = pd.read_csv("bank.csv")
df.head()
X = df.iloc[:,:-1]
y = df.iloc[:,-1]
X_train,X_test,y_train,y_test = train_test_split(X,y,test_size=0.3,random_state=1)<jupyter_output><empty_output><jupyter_text>ADA Boosting<jupyter_code>from sklearn.ensemble import AdaBoostClassifier
ada = AdaBoostClassifier(n_estimators=100)

ada.fit(X_train,y_train)
y_pred = ada.predict(X_test)
print(classification_report(y_test,y_pred))<jupyter_output>precision    recall  f1-score   support

           0       0.83      0.86      0.84      1760
           1       0.83      0.80      0.82      1589

   micro avg       0.83      0.83      0.83      3349
   macro avg       0.83      0.83      0.83      3349
weighted avg       0.83      0.83      0.83      3349<jupyter_text>Gradient Boosting<jupyter_code>from sklearn.ensemble import GradientBoostingClassifier
gb = GradientBoostingClassifier(n_estimators=100)

gb.fit(X_train,y_train)
y_pred = gb.predict(X_test)
print(classification_report(y_test,y_pred))<jupyter_output>precision    recall  f1-score   support

           0       0.87      0.82      0.84      1760
           1       0.81      0.86      0.83      1589

   micro avg       0.84      0.84      0.84      3349
   macro avg       0.84      0.84      0.84      3349
weighted avg       0.84      0.84      0.84      3349<jupyter_text>Xtreme Gradient Boosting<jupyter_code>#!pip install xgboost
from xgboost import XGBClassifier
xgb = XGBClassifier(n_estimators=200,reg_alpha=1)
xgb.fit(X_train,y_train)
y_pred = xgb.predict(X_test)
print(classification_report(y_test,y_pred))<jupyter_output>precision    recall  f1-score   support

           0       0.88      0.82      0.85      1760
           1       0.82      0.87      0.84      1589

   micro avg       0.85      0.85      0.85      3349
   macro avg       0.85      0.85      0.85      3349
weighted avg       0.85      0.85      0.85      3349
{'fraction_non_alphanumeric': 0.07905138339920949, 'fraction_numerical': 0.09617918313570488, 'mean_word_length': 2.379821958456973, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 15, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '639002', 'license': 'MIT', 'n_tokens_mistral': 940, 'n_tokens_neox': 837, 'n_words': 167, 'path': 'Boosting.ipynb', 'repo_name': 'laukik1/ML', 'size': '2277'}