This repository contains the source code and the data related to the paper Margin Optimal Classification Trees by Federico D'Onofrio, Giorgio Grani, Marta Monaci and Laura Palagi.
@article{donofrio2024margin,
title = {Margin optimal classification trees},
journal = {Computers & Operations Research},
volume = {161},
pages = {106441},
year = {2024},
issn = {0305-0548},
doi = {https://doi.org/10.1016/j.cor.2023.106441},
author = {Federico D’Onofrio and Giorgio Grani and Marta Monaci and Laura Palagi}
}
The MIP model for generating MARGOT Trees is implemented in Gurobi Optimizer.
The file requirements.txt reports the list of packages that must be installed to run the code. You can add a package to your environment via pip or anaconda using either pip install "package" or conda install "package".
Then, in order to install pygraphviz, we reccomend to use conda install -c conda-forge pygraphviz.
You just need to run main.py
.
The parameters are set according to the experiments in the paper, but you can simply modify them via main.py
.
The output of the experiments can be found in folder results_margot/, where:
- folder plots/ will contain all the tree plots files related to the experiments performed.
- file stats_margot.xlsx will contain the statistics of all the experiments performed.
Contributors to this code:
- MIT License
- Copyright 2022 © Marta Monaci, Federico D'Onofrio