added MultClassPipe2 that has one hot encoder step to the pipeline

This commit is contained in:
Tanushree Tunstall 2022-03-07 17:36:48 +00:00
parent f5dcf29e25
commit 564e72fc2d
4 changed files with 51 additions and 17 deletions

View file

@ -23,6 +23,7 @@ from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score, confusion_matrix, precision_score, recall_score, roc_auc_score, roc_curve, f1_score
#%%
rs = {'random_state': 42}
# TODO: add preprocessing step with one hot encoder
# Multiple Classification - Model Pipeline
def MultClassPipeline(X_train, X_test, y_train, y_test):
@ -35,6 +36,15 @@ def MultClassPipeline(X_train, X_test, y_train, y_test):
dt = DecisionTreeClassifier(**rs)
et = ExtraTreesClassifier(**rs)
rf = RandomForestClassifier(**rs)
rf2 = RandomForestClassifier(
min_samples_leaf=50,
n_estimators=150,
bootstrap=True,
oob_score=True,
n_jobs=-1,
random_state=42,
max_features='auto')
xgb = XGBClassifier(**rs, verbosity=0)
clfs = [
@ -46,6 +56,7 @@ def MultClassPipeline(X_train, X_test, y_train, y_test):
('Decision Tree', dt),
('Extra Trees', et),
('Random Forest', rf),
('Random Forest2', rf2),
('XGBoost', xgb)
]