The AutoML_PRO1: Tunability project focuses on studying the tunability of hyperparameters in selected machine learning algorithms for binary classification. We analyzed three models:
- DecisionTreeClassifier (scikit-learn)
- KNeighborsClassifier (scikit-learn)
- XGBoost (xgboost)
The study used four different datasets and two methods for sampling hyperparameter points:
- Random Search (RandomizedSearchCV from scikit-learn)
- Bayes Search (BayesSearchCV from scikit-optimize)
The experiment is based on the paper: Tunability: Importance of Hyperparameters of Machine Learning Algorithms.
The experiments were conducted on the following datasets:
- Credit Approval (credit) β 690 rows, 16 columns (credit card data)
- Go To College (college) β 1000 rows, 11 columns (synthetic data on educational decisions)
- Pima Indians Diabetes Database (diabetes) β 768 rows, 9 columns (medical data)
- Palmer Penguins (penguins) β 274 rows, 7 columns (biological data on penguins)
criterion
: [gini
,entropy
,log_loss
]max_depth
: [1, 29]max_leaf_nodes
: [10, 90]
n_neighbors
: [1, 30]weights
: [uniform
,distance
]metric
: [euclidean
,manhattan
,chebyshev
,minkowski
]
booster
: [gbtree
,gblinear
,dart
]learning_rate
: [0.0001, 0.3]max_depth
: [3, 10]lambda
: [2^-10, 2^10]
For each model, we optimized hyperparameters on four datasets using two methods:
- RandomizedSearchCV β random hyperparameter sampling
- BayesSearchCV β probabilistic optimization method
Each iteration used 5-fold cross-validation, and 200 iterations were performed for each method.
-
Best Model:
- XGBoost achieved the highest F1 scores on most datasets, especially on more complex datasets (
credit
,college
). - DecisionTree and KNeighbors obtained competitive results but with higher variance.
- XGBoost achieved the highest F1 scores on most datasets, especially on more complex datasets (
-
Algorithm Tunability:
- XGBoost and DecisionTree exhibited higher tunability with Bayes Search optimization.
- KNeighbors showed lower tunability, meaning hyperparameter selection had less impact on model performance.
-
Comparison of Optimization Methods:
- Bayes Search provided better result stabilization and faster convergence, especially for DecisionTree and XGBoost.
- Random Search produced more unstable results with a limited number of iterations.
-
Number of Iterations for Stable Results:
- Bayes Search required fewer iterations to achieve stable results compared to Random Search.
- The choice of optimization method significantly impacts classification performance and model tunability.
- XGBoost is more sensitive to hyperparameter tuning than KNeighbors.
- Bayes Search is more effective than Random Search with a limited number of iterations.
- The stability of results achieved with Bayes Search suggests that advanced hyperparameter optimization methods should be used in real-world applications.
- Philipp Probst, Anne-Laure Boulesteix, Bernd Bischl β Tunability: Importance of Hyperparameters of Machine Learning Algorithms
- scikit-learn and XGBoost documentation