This project implements a meta-optimized approach to Bayesian Optimization for tuning hyperparameters of a Random Forest Classifier. Our method recursively tunes the hyperparameters of the Bayesian Optimization algorithm itself, resulting in improved classification accuracy and reduced hyperparameter search time when extended to a larger dataset compared to conventional methods. In other words, the algorithm finds suitable search spaces for running Bayesian Optimization on a sample of a larger dataset, then extends the results to determine good hyperparameters for executing the Bayesian Optimization algorithm on the random forest classifier for the original dataset.
The approach is demonstrated on the breast-cancer dataset from Weka, and performance is evaluated based on accuracy, precision, recall, training time, and confusion matrices.
-
Prepare the Dataset:
- The project uses the
breast-cancer.csvdataset from Weka. Ensure the dataset is placed in the same directory as the Python files.
- The project uses the
-
Run the Baseline Model:
- Execute the script for the baseline Random Forest model:
python no-optimization.py
- Execute the script for the baseline Random Forest model:
-
Run Bayesian Optimization on Random Forest:
- Execute the script that applies standard Bayesian Optimization:
python bayesian_optimization.py
- Execute the script that applies standard Bayesian Optimization:
-
Run Meta-Optimized Bayesian Optimization:
- Execute the script where Bayesian Optimization is recursively tuned:
python optimized.py
- Execute the script where Bayesian Optimization is recursively tuned:
-
View Results:
- Check the console output for performance metrics (accuracy, precision, recall, runtime) and confusion matrices.