text_plain_output_1.png
from sklearn.ensemble import RandomForestClassifier

from sklearn.metrics import f1_score ,accuracy_score

from xgboost import XGBClassifier

xgb = XGBClassifier()
model1 = xgb.fit(X_train, y_train)
y_hat = model1.predict(X_test)
f1 = f1_score(y_test, y_hat)
acc = accuracy_score(y_test, y_hat)
(f1, acc)

from sklearn.ensemble import RandomForestClassifier
rfc = RandomForestClassifier()
model2 = rfc.fit(X_train, y_train)
y_hat2 = model2.predict(X_test)
f1 = f1_score(y_test, y_hat2)
acc = accuracy_score(y_test, y_hat2)
(f1, acc)

xgb = XGBClassifier(booster='gbtree', learning_rate=0.3, n_estimators=10)
model1 = xgb.fit(X_train, y_train)
y_hat = model1.predict(X_test)
f1 = f1_score(y_test, y_hat)
acc = accuracy_score(y_test, y_hat)
(f1, acc)