This repository contains a full machine-learning pipeline for training a model, generating predictions, and producing a submission.csv file for Kaggle.
- Python 3.9+
- Git
- A terminal (Linux, macOS, or Windows PowerShell)
git clone https://github.com/simy46/DEFCON.git
cd DEFCONpython3 -m venv venv
source venv/bin/activatepython -m venv venv
venv\Scripts\Activatepip install -r requirements.txtEach config file has three parts: model, preprocessing, and hyperoptimization.
Defines models base hyperparameters.
When running hyperopt:
- parameters set to
Nonefall back to the values here - the final
*_best.yamloverwrites this section with optimized values
Controls all preprocessing steps.
Each step has enabled: true/false.
Only steps with enabled: true are applied.
This structure is identical for every model.
Enables hyperparameter search (grid, random, or optuna).
Only parameters defined here are searched.
Parameters set to None keep their value from the model section.
The pipeline is controlled through a YAML config file.
python main.py --config config/model_rt_best.yamlOther available configs are listed on /config folder. The command that we gave is to run the same configs as our submission.
- Loads the YAML config
- Loads training and test data
- Applies preprocessing (scaling, PCA, etc.)
- Trains the model defined in the config
- Generates predictions on the test set
- Saves a submission file in submissions/submission_.csv
submissions/submission_2025-01-04_14-32-10.csvThis script searches for the best hyperparameters and generates a new optimized config file.
python find_best_params.py --config config/model_<name>_best.yamlOther available configs are listed on /config folder.
- Loads the YAML config
- Loads training and test data
- Applies preprocessing (same pipeline as the main script)
- Builds the model and its search space
- Runs hyperparameter search (Grid Search, Random Search, or Optuna)
- Logs the best score and best parameters
- Writes a new file: config/model_rt_best.yaml with the updated hyperparameters
config/model_<name>_best.yamlAfter generating this file, use it on the main.py pipeline
python main.py --config config/model_<name>_best.yaml