{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "61ef78a3", "metadata": {}, "outputs": [], "source": [ "from pycaret.classification import *\n", "from pycaret.datasets import get_data\n", "import pandas as pd" ] }, { "cell_type": "markdown", "id": "a5e8eefc", "metadata": {}, "source": [ "## Getting the dataset" ] }, { "cell_type": "code", "execution_count": 2, "id": "7e484728", "metadata": { "scrolled": false }, "outputs": [ { "data": { "text/html": [ "
\n", " | age | \n", "job | \n", "marital | \n", "education | \n", "default | \n", "balance | \n", "housing | \n", "loan | \n", "contact | \n", "day | \n", "month | \n", "duration | \n", "campaign | \n", "pdays | \n", "previous | \n", "poutcome | \n", "deposit | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | \n", "58 | \n", "management | \n", "married | \n", "tertiary | \n", "no | \n", "2143 | \n", "yes | \n", "no | \n", "unknown | \n", "5 | \n", "may | \n", "261 | \n", "1 | \n", "-1 | \n", "0 | \n", "unknown | \n", "no | \n", "
1 | \n", "44 | \n", "technician | \n", "single | \n", "secondary | \n", "no | \n", "29 | \n", "yes | \n", "no | \n", "unknown | \n", "5 | \n", "may | \n", "151 | \n", "1 | \n", "-1 | \n", "0 | \n", "unknown | \n", "no | \n", "
2 | \n", "33 | \n", "entrepreneur | \n", "married | \n", "secondary | \n", "no | \n", "2 | \n", "yes | \n", "yes | \n", "unknown | \n", "5 | \n", "may | \n", "76 | \n", "1 | \n", "-1 | \n", "0 | \n", "unknown | \n", "no | \n", "
3 | \n", "47 | \n", "blue-collar | \n", "married | \n", "unknown | \n", "no | \n", "1506 | \n", "yes | \n", "no | \n", "unknown | \n", "5 | \n", "may | \n", "92 | \n", "1 | \n", "-1 | \n", "0 | \n", "unknown | \n", "no | \n", "
4 | \n", "33 | \n", "unknown | \n", "single | \n", "unknown | \n", "no | \n", "1 | \n", "no | \n", "no | \n", "unknown | \n", "5 | \n", "may | \n", "198 | \n", "1 | \n", "-1 | \n", "0 | \n", "unknown | \n", "no | \n", "
\n", " | age | \n", "job | \n", "marital | \n", "education | \n", "default | \n", "balance | \n", "housing | \n", "loan | \n", "contact | \n", "day | \n", "month | \n", "duration | \n", "campaign | \n", "pdays | \n", "previous | \n", "poutcome | \n", "deposit | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
8863 | \n", "29 | \n", "blue-collar | \n", "married | \n", "primary | \n", "no | \n", "25 | \n", "yes | \n", "no | \n", "unknown | \n", "4 | \n", "jun | \n", "188 | \n", "2 | \n", "-1 | \n", "0 | \n", "unknown | \n", "no | \n", "
22688 | \n", "40 | \n", "technician | \n", "divorced | \n", "secondary | \n", "no | \n", "237 | \n", "no | \n", "no | \n", "cellular | \n", "25 | \n", "aug | \n", "87 | \n", "5 | \n", "-1 | \n", "0 | \n", "unknown | \n", "no | \n", "
961 | \n", "57 | \n", "retired | \n", "married | \n", "tertiary | \n", "no | \n", "906 | \n", "yes | \n", "no | \n", "unknown | \n", "7 | \n", "may | \n", "117 | \n", "1 | \n", "-1 | \n", "0 | \n", "unknown | \n", "no | \n", "
10229 | \n", "45 | \n", "services | \n", "married | \n", "primary | \n", "no | \n", "116 | \n", "yes | \n", "no | \n", "unknown | \n", "11 | \n", "jun | \n", "287 | \n", "3 | \n", "-1 | \n", "0 | \n", "unknown | \n", "no | \n", "
21189 | \n", "48 | \n", "blue-collar | \n", "married | \n", "primary | \n", "no | \n", "-83 | \n", "no | \n", "no | \n", "cellular | \n", "14 | \n", "aug | \n", "136 | \n", "3 | \n", "-1 | \n", "0 | \n", "unknown | \n", "no | \n", "
... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
25728 | \n", "58 | \n", "blue-collar | \n", "divorced | \n", "primary | \n", "no | \n", "8218 | \n", "yes | \n", "no | \n", "cellular | \n", "19 | \n", "nov | \n", "141 | \n", "2 | \n", "111 | \n", "10 | \n", "failure | \n", "no | \n", "
33430 | \n", "28 | \n", "student | \n", "single | \n", "secondary | \n", "no | \n", "0 | \n", "no | \n", "no | \n", "cellular | \n", "20 | \n", "apr | \n", "185 | \n", "1 | \n", "-1 | \n", "0 | \n", "unknown | \n", "yes | \n", "
7481 | \n", "44 | \n", "blue-collar | \n", "single | \n", "primary | \n", "no | \n", "1593 | \n", "yes | \n", "no | \n", "unknown | \n", "29 | \n", "may | \n", "828 | \n", "3 | \n", "-1 | \n", "0 | \n", "unknown | \n", "yes | \n", "
4593 | \n", "40 | \n", "services | \n", "married | \n", "primary | \n", "no | \n", "3559 | \n", "yes | \n", "no | \n", "unknown | \n", "20 | \n", "may | \n", "138 | \n", "8 | \n", "-1 | \n", "0 | \n", "unknown | \n", "no | \n", "
42680 | \n", "37 | \n", "management | \n", "married | \n", "tertiary | \n", "no | \n", "0 | \n", "no | \n", "no | \n", "cellular | \n", "15 | \n", "jan | \n", "426 | \n", "2 | \n", "196 | \n", "1 | \n", "other | \n", "yes | \n", "
38429 rows × 17 columns
\n", "\n", " | age | \n", "job | \n", "marital | \n", "education | \n", "default | \n", "balance | \n", "housing | \n", "loan | \n", "contact | \n", "day | \n", "month | \n", "duration | \n", "campaign | \n", "pdays | \n", "previous | \n", "poutcome | \n", "deposit | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2 | \n", "33 | \n", "entrepreneur | \n", "married | \n", "secondary | \n", "no | \n", "2 | \n", "yes | \n", "yes | \n", "unknown | \n", "5 | \n", "may | \n", "76 | \n", "1 | \n", "-1 | \n", "0 | \n", "unknown | \n", "no | \n", "
4 | \n", "33 | \n", "unknown | \n", "single | \n", "unknown | \n", "no | \n", "1 | \n", "no | \n", "no | \n", "unknown | \n", "5 | \n", "may | \n", "198 | \n", "1 | \n", "-1 | \n", "0 | \n", "unknown | \n", "no | \n", "
16 | \n", "45 | \n", "admin. | \n", "single | \n", "unknown | \n", "no | \n", "13 | \n", "yes | \n", "no | \n", "unknown | \n", "5 | \n", "may | \n", "98 | \n", "1 | \n", "-1 | \n", "0 | \n", "unknown | \n", "no | \n", "
41 | \n", "50 | \n", "management | \n", "married | \n", "secondary | \n", "no | \n", "49 | \n", "yes | \n", "no | \n", "unknown | \n", "5 | \n", "may | \n", "180 | \n", "2 | \n", "-1 | \n", "0 | \n", "unknown | \n", "no | \n", "
52 | \n", "32 | \n", "management | \n", "married | \n", "tertiary | \n", "no | \n", "0 | \n", "yes | \n", "no | \n", "unknown | \n", "5 | \n", "may | \n", "179 | \n", "1 | \n", "-1 | \n", "0 | \n", "unknown | \n", "no | \n", "
... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
45184 | \n", "63 | \n", "retired | \n", "married | \n", "secondary | \n", "no | \n", "1495 | \n", "no | \n", "no | \n", "cellular | \n", "16 | \n", "nov | \n", "138 | \n", "1 | \n", "22 | \n", "5 | \n", "success | \n", "no | \n", "
45189 | \n", "25 | \n", "services | \n", "single | \n", "secondary | \n", "no | \n", "199 | \n", "no | \n", "no | \n", "cellular | \n", "16 | \n", "nov | \n", "173 | \n", "1 | \n", "92 | \n", "5 | \n", "failure | \n", "no | \n", "
45201 | \n", "53 | \n", "management | \n", "married | \n", "tertiary | \n", "no | \n", "583 | \n", "no | \n", "no | \n", "cellular | \n", "17 | \n", "nov | \n", "226 | \n", "1 | \n", "184 | \n", "4 | \n", "success | \n", "yes | \n", "
45207 | \n", "71 | \n", "retired | \n", "divorced | \n", "primary | \n", "no | \n", "1729 | \n", "no | \n", "no | \n", "cellular | \n", "17 | \n", "nov | \n", "456 | \n", "2 | \n", "-1 | \n", "0 | \n", "unknown | \n", "yes | \n", "
45210 | \n", "37 | \n", "entrepreneur | \n", "married | \n", "secondary | \n", "no | \n", "2971 | \n", "no | \n", "no | \n", "cellular | \n", "17 | \n", "nov | \n", "361 | \n", "2 | \n", "188 | \n", "11 | \n", "other | \n", "no | \n", "
6782 rows × 17 columns
\n", "\n", " | Description | \n", "Value | \n", "
---|---|---|
0 | \n", "Session id | \n", "321 | \n", "
1 | \n", "Target | \n", "deposit | \n", "
2 | \n", "Target type | \n", "Binary | \n", "
3 | \n", "Target mapping | \n", "no: 0, yes: 1 | \n", "
4 | \n", "Original data shape | \n", "(38429, 17) | \n", "
5 | \n", "Transformed data shape | \n", "(38429, 49) | \n", "
6 | \n", "Transformed train set shape | \n", "(26900, 49) | \n", "
7 | \n", "Transformed test set shape | \n", "(11529, 49) | \n", "
8 | \n", "Ordinal features | \n", "3 | \n", "
9 | \n", "Numeric features | \n", "7 | \n", "
10 | \n", "Categorical features | \n", "9 | \n", "
11 | \n", "Preprocess | \n", "True | \n", "
12 | \n", "Imputation type | \n", "simple | \n", "
13 | \n", "Numeric imputation | \n", "mean | \n", "
14 | \n", "Categorical imputation | \n", "mode | \n", "
15 | \n", "Maximum one-hot encoding | \n", "25 | \n", "
16 | \n", "Encoding method | \n", "None | \n", "
17 | \n", "Fold Generator | \n", "StratifiedKFold | \n", "
18 | \n", "Fold Number | \n", "10 | \n", "
19 | \n", "CPU Jobs | \n", "-1 | \n", "
20 | \n", "Use GPU | \n", "False | \n", "
21 | \n", "Log Experiment | \n", "False | \n", "
22 | \n", "Experiment Name | \n", "clf-default-name | \n", "
23 | \n", "USI | \n", "dfd7 | \n", "
\n", " | Model | \n", "Accuracy | \n", "AUC | \n", "Recall | \n", "Prec. | \n", "F1 | \n", "Kappa | \n", "MCC | \n", "TT (Sec) | \n", "
---|---|---|---|---|---|---|---|---|---|
catboost | \n", "CatBoost Classifier | \n", "0.9091 | \n", "0.9364 | \n", "0.4839 | \n", "0.6495 | \n", "0.5541 | \n", "0.5047 | \n", "0.5118 | \n", "1.4950 | \n", "
lightgbm | \n", "Light Gradient Boosting Machine | \n", "0.9081 | \n", "0.9347 | \n", "0.4814 | \n", "0.6432 | \n", "0.5499 | \n", "0.5000 | \n", "0.5069 | \n", "1.4960 | \n", "
xgboost | \n", "Extreme Gradient Boosting | \n", "0.9072 | \n", "0.9309 | \n", "0.4884 | \n", "0.6344 | \n", "0.5513 | \n", "0.5005 | \n", "0.5062 | \n", "1.2350 | \n", "
gbc | \n", "Gradient Boosting Classifier | \n", "0.9056 | \n", "0.9262 | \n", "0.4054 | \n", "0.6556 | \n", "0.5003 | \n", "0.4514 | \n", "0.4677 | \n", "1.4290 | \n", "
rf | \n", "Random Forest Classifier | \n", "0.9039 | \n", "0.9267 | \n", "0.3653 | \n", "0.6622 | \n", "0.4703 | \n", "0.4223 | \n", "0.4453 | \n", "1.5270 | \n", "
lr | \n", "Logistic Regression | \n", "0.9015 | \n", "0.9038 | \n", "0.3475 | \n", "0.6459 | \n", "0.4510 | \n", "0.4023 | \n", "0.4261 | \n", "2.5670 | \n", "
lda | \n", "Linear Discriminant Analysis | \n", "0.9002 | \n", "0.9078 | \n", "0.4432 | \n", "0.5987 | \n", "0.5089 | \n", "0.4548 | \n", "0.4614 | \n", "1.2640 | \n", "
ridge | \n", "Ridge Classifier | \n", "0.9000 | \n", "0.0000 | \n", "0.2838 | \n", "0.6716 | \n", "0.3982 | \n", "0.3534 | \n", "0.3931 | \n", "1.4140 | \n", "
ada | \n", "Ada Boost Classifier | \n", "0.8997 | \n", "0.9093 | \n", "0.3799 | \n", "0.6143 | \n", "0.4686 | \n", "0.4168 | \n", "0.4319 | \n", "1.3580 | \n", "
et | \n", "Extra Trees Classifier | \n", "0.8984 | \n", "0.9050 | \n", "0.3248 | \n", "0.6292 | \n", "0.4279 | \n", "0.3783 | \n", "0.4036 | \n", "1.6490 | \n", "
dummy | \n", "Dummy Classifier | \n", "0.8832 | \n", "0.5000 | \n", "0.0000 | \n", "0.0000 | \n", "0.0000 | \n", "0.0000 | \n", "0.0000 | \n", "1.2130 | \n", "
knn | \n", "K Neighbors Classifier | \n", "0.8819 | \n", "0.7584 | \n", "0.2644 | \n", "0.4899 | \n", "0.3432 | \n", "0.2847 | \n", "0.3012 | \n", "2.0930 | \n", "
dt | \n", "Decision Tree Classifier | \n", "0.8736 | \n", "0.7037 | \n", "0.4820 | \n", "0.4611 | \n", "0.4709 | \n", "0.3992 | \n", "0.3996 | \n", "1.4360 | \n", "
nb | \n", "Naive Bayes | \n", "0.8597 | \n", "0.8250 | \n", "0.5215 | \n", "0.4196 | \n", "0.4649 | \n", "0.3853 | \n", "0.3884 | \n", "1.3590 | \n", "
qda | \n", "Quadratic Discriminant Analysis | \n", "0.8586 | \n", "0.8231 | \n", "0.4773 | \n", "0.4240 | \n", "0.4430 | \n", "0.3640 | \n", "0.3679 | \n", "1.4850 | \n", "
svm | \n", "SVM - Linear Kernel | \n", "0.8302 | \n", "0.0000 | \n", "0.2081 | \n", "0.2674 | \n", "0.2054 | \n", "0.1224 | \n", "0.1347 | \n", "1.4500 | \n", "
\n", " | Name | \n", "Reference | \n", "Turbo | \n", "
---|---|---|---|
ID | \n", "\n", " | \n", " | \n", " |
lr | \n", "Logistic Regression | \n", "sklearn.linear_model._logistic.LogisticRegression | \n", "True | \n", "
knn | \n", "K Neighbors Classifier | \n", "sklearn.neighbors._classification.KNeighborsCl... | \n", "True | \n", "
nb | \n", "Naive Bayes | \n", "sklearn.naive_bayes.GaussianNB | \n", "True | \n", "
dt | \n", "Decision Tree Classifier | \n", "sklearn.tree._classes.DecisionTreeClassifier | \n", "True | \n", "
svm | \n", "SVM - Linear Kernel | \n", "sklearn.linear_model._stochastic_gradient.SGDC... | \n", "True | \n", "
rbfsvm | \n", "SVM - Radial Kernel | \n", "sklearn.svm._classes.SVC | \n", "False | \n", "
gpc | \n", "Gaussian Process Classifier | \n", "sklearn.gaussian_process._gpc.GaussianProcessC... | \n", "False | \n", "
mlp | \n", "MLP Classifier | \n", "sklearn.neural_network._multilayer_perceptron.... | \n", "False | \n", "
ridge | \n", "Ridge Classifier | \n", "sklearn.linear_model._ridge.RidgeClassifier | \n", "True | \n", "
rf | \n", "Random Forest Classifier | \n", "sklearn.ensemble._forest.RandomForestClassifier | \n", "True | \n", "
qda | \n", "Quadratic Discriminant Analysis | \n", "sklearn.discriminant_analysis.QuadraticDiscrim... | \n", "True | \n", "
ada | \n", "Ada Boost Classifier | \n", "sklearn.ensemble._weight_boosting.AdaBoostClas... | \n", "True | \n", "
gbc | \n", "Gradient Boosting Classifier | \n", "sklearn.ensemble._gb.GradientBoostingClassifier | \n", "True | \n", "
lda | \n", "Linear Discriminant Analysis | \n", "sklearn.discriminant_analysis.LinearDiscrimina... | \n", "True | \n", "
et | \n", "Extra Trees Classifier | \n", "sklearn.ensemble._forest.ExtraTreesClassifier | \n", "True | \n", "
xgboost | \n", "Extreme Gradient Boosting | \n", "xgboost.sklearn.XGBClassifier | \n", "True | \n", "
lightgbm | \n", "Light Gradient Boosting Machine | \n", "lightgbm.sklearn.LGBMClassifier | \n", "True | \n", "
catboost | \n", "CatBoost Classifier | \n", "catboost.core.CatBoostClassifier | \n", "True | \n", "
dummy | \n", "Dummy Classifier | \n", "sklearn.dummy.DummyClassifier | \n", "True | \n", "
\n", " | Accuracy | \n", "AUC | \n", "Recall | \n", "Prec. | \n", "F1 | \n", "Kappa | \n", "MCC | \n", "
---|---|---|---|---|---|---|---|
Fold | \n", "\n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " |
0 | \n", "0.9164 | \n", "0.9336 | \n", "0.4841 | \n", "0.7070 | \n", "0.5747 | \n", "0.5301 | \n", "0.5418 | \n", "
1 | \n", "0.9078 | \n", "0.9276 | \n", "0.3854 | \n", "0.6875 | \n", "0.4939 | \n", "0.4476 | \n", "0.4703 | \n", "
2 | \n", "0.9004 | \n", "0.9253 | \n", "0.3662 | \n", "0.6250 | \n", "0.4618 | \n", "0.4110 | \n", "0.4289 | \n", "
3 | \n", "0.9063 | \n", "0.9207 | \n", "0.4236 | \n", "0.6520 | \n", "0.5135 | \n", "0.4643 | \n", "0.4775 | \n", "
4 | \n", "0.9078 | \n", "0.9369 | \n", "0.4108 | \n", "0.6719 | \n", "0.5099 | \n", "0.4622 | \n", "0.4793 | \n", "
5 | \n", "0.9059 | \n", "0.9268 | \n", "0.4076 | \n", "0.6564 | \n", "0.5029 | \n", "0.4541 | \n", "0.4699 | \n", "
6 | \n", "0.9011 | \n", "0.9309 | \n", "0.4236 | \n", "0.6101 | \n", "0.5000 | \n", "0.4471 | \n", "0.4563 | \n", "
7 | \n", "0.9048 | \n", "0.9221 | \n", "0.3714 | \n", "0.6686 | \n", "0.4776 | \n", "0.4299 | \n", "0.4524 | \n", "
8 | \n", "0.9011 | \n", "0.9140 | \n", "0.3651 | \n", "0.6354 | \n", "0.4637 | \n", "0.4136 | \n", "0.4329 | \n", "
9 | \n", "0.9045 | \n", "0.9240 | \n", "0.4159 | \n", "0.6422 | \n", "0.5048 | \n", "0.4546 | \n", "0.4678 | \n", "
Mean | \n", "0.9056 | \n", "0.9262 | \n", "0.4054 | \n", "0.6556 | \n", "0.5003 | \n", "0.4514 | \n", "0.4677 | \n", "
Std | \n", "0.0044 | \n", "0.0063 | \n", "0.0342 | \n", "0.0278 | \n", "0.0303 | \n", "0.0317 | \n", "0.0297 | \n", "
\n", " | Accuracy | \n", "AUC | \n", "Recall | \n", "Prec. | \n", "F1 | \n", "Kappa | \n", "MCC | \n", "
---|---|---|---|---|---|---|---|
Fold | \n", "\n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " |
0 | \n", "0.9104 | \n", "0.9373 | \n", "0.4841 | \n", "0.6580 | \n", "0.5578 | \n", "0.5092 | \n", "0.5167 | \n", "
1 | \n", "0.9082 | \n", "0.9295 | \n", "0.4299 | \n", "0.6650 | \n", "0.5222 | \n", "0.4740 | \n", "0.4879 | \n", "
2 | \n", "0.9045 | \n", "0.9278 | \n", "0.4841 | \n", "0.6154 | \n", "0.5419 | \n", "0.4894 | \n", "0.4938 | \n", "
3 | \n", "0.9097 | \n", "0.9253 | \n", "0.5159 | \n", "0.6403 | \n", "0.5714 | \n", "0.5216 | \n", "0.5254 | \n", "
4 | \n", "0.9100 | \n", "0.9418 | \n", "0.4713 | \n", "0.6607 | \n", "0.5502 | \n", "0.5018 | \n", "0.5106 | \n", "
5 | \n", "0.9041 | \n", "0.9241 | \n", "0.4682 | \n", "0.6176 | \n", "0.5326 | \n", "0.4803 | \n", "0.4860 | \n", "
6 | \n", "0.9059 | \n", "0.9326 | \n", "0.4904 | \n", "0.6235 | \n", "0.5490 | \n", "0.4974 | \n", "0.5018 | \n", "
7 | \n", "0.9037 | \n", "0.9288 | \n", "0.4603 | \n", "0.6197 | \n", "0.5282 | \n", "0.4759 | \n", "0.4824 | \n", "
8 | \n", "0.9011 | \n", "0.9207 | \n", "0.4540 | \n", "0.6034 | \n", "0.5181 | \n", "0.4642 | \n", "0.4701 | \n", "
9 | \n", "0.9071 | \n", "0.9283 | \n", "0.4857 | \n", "0.6349 | \n", "0.5504 | \n", "0.4996 | \n", "0.5051 | \n", "
Mean | \n", "0.9065 | \n", "0.9296 | \n", "0.4744 | \n", "0.6338 | \n", "0.5422 | \n", "0.4913 | \n", "0.4980 | \n", "
Std | \n", "0.0030 | \n", "0.0059 | \n", "0.0222 | \n", "0.0204 | \n", "0.0159 | \n", "0.0169 | \n", "0.0162 | \n", "
Pipeline(memory=FastMemory(location=C:\\Users\\owner\\AppData\\Local\\Temp\\joblib),\n", " steps=[('label_encoding',\n", " TransformerWrapperWithInverse(exclude=None, include=None,\n", " transformer=LabelEncoder())),\n", " ('numerical_imputer',\n", " TransformerWrapper(exclude=None,\n", " include=['age', 'balance', 'day',\n", " 'duration', 'campaign', 'pdays',\n", " 'previous'],\n", " transformer=SimpleImputer(add_indica...\n", " criterion='friedman_mse', init=None,\n", " learning_rate=0.3, loss='log_loss',\n", " max_depth=5, max_features='sqrt',\n", " max_leaf_nodes=None,\n", " min_impurity_decrease=0.01,\n", " min_samples_leaf=3,\n", " min_samples_split=4,\n", " min_weight_fraction_leaf=0.0,\n", " n_estimators=80,\n", " n_iter_no_change=None,\n", " random_state=321, subsample=0.95,\n", " tol=0.0001, validation_fraction=0.1,\n", " verbose=0, warm_start=False))],\n", " verbose=False)In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook.
Pipeline(memory=FastMemory(location=C:\\Users\\owner\\AppData\\Local\\Temp\\joblib),\n", " steps=[('label_encoding',\n", " TransformerWrapperWithInverse(exclude=None, include=None,\n", " transformer=LabelEncoder())),\n", " ('numerical_imputer',\n", " TransformerWrapper(exclude=None,\n", " include=['age', 'balance', 'day',\n", " 'duration', 'campaign', 'pdays',\n", " 'previous'],\n", " transformer=SimpleImputer(add_indica...\n", " criterion='friedman_mse', init=None,\n", " learning_rate=0.3, loss='log_loss',\n", " max_depth=5, max_features='sqrt',\n", " max_leaf_nodes=None,\n", " min_impurity_decrease=0.01,\n", " min_samples_leaf=3,\n", " min_samples_split=4,\n", " min_weight_fraction_leaf=0.0,\n", " n_estimators=80,\n", " n_iter_no_change=None,\n", " random_state=321, subsample=0.95,\n", " tol=0.0001, validation_fraction=0.1,\n", " verbose=0, warm_start=False))],\n", " verbose=False)
TransformerWrapperWithInverse(exclude=None, include=None,\n", " transformer=LabelEncoder())
LabelEncoder()
LabelEncoder()
TransformerWrapper(exclude=None,\n", " include=['age', 'balance', 'day', 'duration', 'campaign',\n", " 'pdays', 'previous'],\n", " transformer=SimpleImputer(add_indicator=False, copy=True,\n", " fill_value=None,\n", " keep_empty_features=False,\n", " missing_values=nan,\n", " strategy='mean',\n", " verbose='deprecated'))
SimpleImputer()
SimpleImputer()
TransformerWrapper(exclude=None,\n", " include=['job', 'marital', 'education', 'default', 'housing',\n", " 'loan', 'contact', 'month', 'poutcome'],\n", " transformer=SimpleImputer(add_indicator=False, copy=True,\n", " fill_value=None,\n", " keep_empty_features=False,\n", " missing_values=nan,\n", " strategy='most_frequent',\n", " verbose='deprecated'))
SimpleImputer(strategy='most_frequent')
SimpleImputer(strategy='most_frequent')
TransformerWrapper(exclude=None, include=['default', 'housing', 'loan'],\n", " transformer=OrdinalEncoder(cols=['default', 'housing',\n", " 'loan'],\n", " drop_invariant=False,\n", " handle_missing='return_nan',\n", " handle_unknown='value',\n", " mapping=[{'col': 'default',\n", " 'data_type': dtype('O'),\n", " 'mapping': no 0\n", "yes 1\n", "NaN -1\n", "dtype: int64},\n", " {'col': 'housing',\n", " 'data_type': dtype('O'),\n", " 'mapping': no 0\n", "yes 1\n", "NaN -1\n", "dtype: int64},\n", " {'col': 'loan',\n", " 'data_type': dtype('O'),\n", " 'mapping': no 0\n", "yes 1\n", "NaN -1\n", "dtype: int64}],\n", " return_df=True, verbose=0))
OrdinalEncoder(cols=['default', 'housing', 'loan'], handle_missing='return_nan',\n", " mapping=[{'col': 'default', 'data_type': dtype('O'),\n", " 'mapping': no 0\n", "yes 1\n", "NaN -1\n", "dtype: int64},\n", " {'col': 'housing', 'data_type': dtype('O'),\n", " 'mapping': no 0\n", "yes 1\n", "NaN -1\n", "dtype: int64},\n", " {'col': 'loan', 'data_type': dtype('O'),\n", " 'mapping': no 0\n", "yes 1\n", "NaN -1\n", "dtype: int64}])
OrdinalEncoder(cols=['default', 'housing', 'loan'], handle_missing='return_nan',\n", " mapping=[{'col': 'default', 'data_type': dtype('O'),\n", " 'mapping': no 0\n", "yes 1\n", "NaN -1\n", "dtype: int64},\n", " {'col': 'housing', 'data_type': dtype('O'),\n", " 'mapping': no 0\n", "yes 1\n", "NaN -1\n", "dtype: int64},\n", " {'col': 'loan', 'data_type': dtype('O'),\n", " 'mapping': no 0\n", "yes 1\n", "NaN -1\n", "dtype: int64}])
TransformerWrapper(exclude=None,\n", " include=['job', 'marital', 'education', 'contact', 'month',\n", " 'poutcome'],\n", " transformer=OneHotEncoder(cols=['job', 'marital',\n", " 'education', 'contact',\n", " 'month', 'poutcome'],\n", " drop_invariant=False,\n", " handle_missing='return_nan',\n", " handle_unknown='value',\n", " return_df=True, use_cat_names=True,\n", " verbose=0))
OneHotEncoder(cols=['job', 'marital', 'education', 'contact', 'month',\n", " 'poutcome'],\n", " handle_missing='return_nan', use_cat_names=True)
OneHotEncoder(cols=['job', 'marital', 'education', 'contact', 'month',\n", " 'poutcome'],\n", " handle_missing='return_nan', use_cat_names=True)
GradientBoostingClassifier(learning_rate=0.3, max_depth=5, max_features='sqrt',\n", " min_impurity_decrease=0.01, min_samples_leaf=3,\n", " min_samples_split=4, n_estimators=80,\n", " random_state=321, subsample=0.95)
\n", " | Model | \n", "Accuracy | \n", "AUC | \n", "Recall | \n", "Prec. | \n", "F1 | \n", "Kappa | \n", "MCC | \n", "
---|---|---|---|---|---|---|---|---|
0 | \n", "Gradient Boosting Classifier | \n", "0.9300 | \n", "0.9563 | \n", "0 | \n", "0 | \n", "0 | \n", "0.6217 | \n", "0.6289 | \n", "
\n", " | age | \n", "job | \n", "marital | \n", "education | \n", "default | \n", "balance | \n", "housing | \n", "loan | \n", "contact | \n", "day | \n", "month | \n", "duration | \n", "campaign | \n", "pdays | \n", "previous | \n", "poutcome | \n", "deposit | \n", "prediction_label | \n", "prediction_score | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6528 | \n", "42 | \n", "management | \n", "married | \n", "tertiary | \n", "no | \n", "144 | \n", "no | \n", "no | \n", "cellular | \n", "4 | \n", "mar | \n", "148 | \n", "1 | \n", "87 | \n", "4 | \n", "failure | \n", "yes | \n", "no | \n", "0.5555 | \n", "
34032 | \n", "51 | \n", "unemployed | \n", "married | \n", "secondary | \n", "no | \n", "636 | \n", "no | \n", "no | \n", "cellular | \n", "30 | \n", "jan | \n", "321 | \n", "1 | \n", "-1 | \n", "0 | \n", "unknown | \n", "no | \n", "no | \n", "0.9481 | \n", "
30754 | \n", "36 | \n", "blue-collar | \n", "single | \n", "secondary | \n", "no | \n", "2235 | \n", "yes | \n", "no | \n", "cellular | \n", "20 | \n", "nov | \n", "287 | \n", "2 | \n", "-1 | \n", "0 | \n", "unknown | \n", "no | \n", "no | \n", "0.9765 | \n", "
34456 | \n", "48 | \n", "services | \n", "married | \n", "secondary | \n", "no | \n", "116 | \n", "yes | \n", "no | \n", "telephone | \n", "20 | \n", "apr | \n", "70 | \n", "4 | \n", "-1 | \n", "0 | \n", "unknown | \n", "no | \n", "no | \n", "0.9978 | \n", "
13459 | \n", "30 | \n", "unknown | \n", "single | \n", "tertiary | \n", "no | \n", "6836 | \n", "no | \n", "no | \n", "cellular | \n", "27 | \n", "feb | \n", "30 | \n", "3 | \n", "-1 | \n", "0 | \n", "unknown | \n", "no | \n", "no | \n", "0.7563 | \n", "
... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
5728 | \n", "56 | \n", "services | \n", "married | \n", "secondary | \n", "no | \n", "83 | \n", "no | \n", "no | \n", "cellular | \n", "27 | \n", "aug | \n", "26 | \n", "11 | \n", "-1 | \n", "0 | \n", "unknown | \n", "no | \n", "no | \n", "0.9970 | \n", "
25520 | \n", "42 | \n", "blue-collar | \n", "divorced | \n", "unknown | \n", "no | \n", "0 | \n", "no | \n", "no | \n", "cellular | \n", "7 | \n", "jul | \n", "64 | \n", "2 | \n", "-1 | \n", "0 | \n", "unknown | \n", "no | \n", "no | \n", "0.9964 | \n", "
26232 | \n", "31 | \n", "services | \n", "married | \n", "secondary | \n", "no | \n", "428 | \n", "yes | \n", "no | \n", "unknown | \n", "21 | \n", "may | \n", "272 | \n", "1 | \n", "-1 | \n", "0 | \n", "unknown | \n", "no | \n", "no | \n", "0.9913 | \n", "
19434 | \n", "30 | \n", "blue-collar | \n", "married | \n", "secondary | \n", "no | \n", "664 | \n", "no | \n", "yes | \n", "telephone | \n", "14 | \n", "may | \n", "57 | \n", "1 | \n", "-1 | \n", "0 | \n", "unknown | \n", "no | \n", "no | \n", "0.9900 | \n", "
30192 | \n", "55 | \n", "management | \n", "married | \n", "tertiary | \n", "no | \n", "236 | \n", "no | \n", "no | \n", "cellular | \n", "4 | \n", "aug | \n", "200 | \n", "1 | \n", "-1 | \n", "0 | \n", "unknown | \n", "no | \n", "no | \n", "0.9249 | \n", "
11529 rows × 19 columns
\n", "\n", " | Model | \n", "Accuracy | \n", "AUC | \n", "Recall | \n", "Prec. | \n", "F1 | \n", "Kappa | \n", "MCC | \n", "
---|---|---|---|---|---|---|---|---|
0 | \n", "Gradient Boosting Classifier | \n", "0.9068 | \n", "0.9340 | \n", "0 | \n", "0 | \n", "0 | \n", "0.5002 | \n", "0.5059 | \n", "
\n", " | age | \n", "job | \n", "marital | \n", "education | \n", "default | \n", "balance | \n", "housing | \n", "loan | \n", "contact | \n", "day | \n", "month | \n", "duration | \n", "campaign | \n", "pdays | \n", "previous | \n", "poutcome | \n", "deposit | \n", "prediction_label | \n", "prediction_score | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | \n", "33 | \n", "entrepreneur | \n", "married | \n", "secondary | \n", "no | \n", "2 | \n", "yes | \n", "yes | \n", "unknown | \n", "5 | \n", "may | \n", "76 | \n", "1 | \n", "-1 | \n", "0 | \n", "unknown | \n", "no | \n", "no | \n", "0.9993 | \n", "
1 | \n", "33 | \n", "unknown | \n", "single | \n", "unknown | \n", "no | \n", "1 | \n", "no | \n", "no | \n", "unknown | \n", "5 | \n", "may | \n", "198 | \n", "1 | \n", "-1 | \n", "0 | \n", "unknown | \n", "no | \n", "no | \n", "0.9978 | \n", "
2 | \n", "45 | \n", "admin. | \n", "single | \n", "unknown | \n", "no | \n", "13 | \n", "yes | \n", "no | \n", "unknown | \n", "5 | \n", "may | \n", "98 | \n", "1 | \n", "-1 | \n", "0 | \n", "unknown | \n", "no | \n", "no | \n", "0.9979 | \n", "
3 | \n", "50 | \n", "management | \n", "married | \n", "secondary | \n", "no | \n", "49 | \n", "yes | \n", "no | \n", "unknown | \n", "5 | \n", "may | \n", "180 | \n", "2 | \n", "-1 | \n", "0 | \n", "unknown | \n", "no | \n", "no | \n", "0.9967 | \n", "
4 | \n", "32 | \n", "management | \n", "married | \n", "tertiary | \n", "no | \n", "0 | \n", "yes | \n", "no | \n", "unknown | \n", "5 | \n", "may | \n", "179 | \n", "1 | \n", "-1 | \n", "0 | \n", "unknown | \n", "no | \n", "no | \n", "0.9967 | \n", "
\n", " | Model | \n", "Accuracy | \n", "AUC | \n", "Recall | \n", "Prec. | \n", "F1 | \n", "Kappa | \n", "MCC | \n", "
---|---|---|---|---|---|---|---|---|
0 | \n", "Gradient Boosting Classifier | \n", "0.9068 | \n", "0.9340 | \n", "0 | \n", "0 | \n", "0 | \n", "0.5002 | \n", "0.5059 | \n", "
\n", " | age | \n", "job | \n", "marital | \n", "education | \n", "default | \n", "balance | \n", "housing | \n", "loan | \n", "contact | \n", "day | \n", "month | \n", "duration | \n", "campaign | \n", "pdays | \n", "previous | \n", "poutcome | \n", "deposit | \n", "prediction_label | \n", "prediction_score | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | \n", "33 | \n", "entrepreneur | \n", "married | \n", "secondary | \n", "no | \n", "2 | \n", "yes | \n", "yes | \n", "unknown | \n", "5 | \n", "may | \n", "76 | \n", "1 | \n", "-1 | \n", "0 | \n", "unknown | \n", "no | \n", "no | \n", "0.9993 | \n", "
1 | \n", "33 | \n", "unknown | \n", "single | \n", "unknown | \n", "no | \n", "1 | \n", "no | \n", "no | \n", "unknown | \n", "5 | \n", "may | \n", "198 | \n", "1 | \n", "-1 | \n", "0 | \n", "unknown | \n", "no | \n", "no | \n", "0.9978 | \n", "
2 | \n", "45 | \n", "admin. | \n", "single | \n", "unknown | \n", "no | \n", "13 | \n", "yes | \n", "no | \n", "unknown | \n", "5 | \n", "may | \n", "98 | \n", "1 | \n", "-1 | \n", "0 | \n", "unknown | \n", "no | \n", "no | \n", "0.9979 | \n", "
3 | \n", "50 | \n", "management | \n", "married | \n", "secondary | \n", "no | \n", "49 | \n", "yes | \n", "no | \n", "unknown | \n", "5 | \n", "may | \n", "180 | \n", "2 | \n", "-1 | \n", "0 | \n", "unknown | \n", "no | \n", "no | \n", "0.9967 | \n", "
4 | \n", "32 | \n", "management | \n", "married | \n", "tertiary | \n", "no | \n", "0 | \n", "yes | \n", "no | \n", "unknown | \n", "5 | \n", "may | \n", "179 | \n", "1 | \n", "-1 | \n", "0 | \n", "unknown | \n", "no | \n", "no | \n", "0.9967 | \n", "