Skip to content

Latest commit

 

History

History
42 lines (30 loc) · 1.91 KB

File metadata and controls

42 lines (30 loc) · 1.91 KB

Multi-Objective Neural Basis Model (MONBM)

This is the code for the paper "Interpretable and Fair Generalized Additive Neural Networks via Multi-objective Learning", in which we propose a method to simultaneously consider the accuracy, interpretability and fairness of the model.

Dataset

The dataset files should be placed in the dataset/data/ folder and the corresponding pre-processing code should be written, e.g., dataset/data/Adult.csv and dataset/tabular_adult.py.

The data Adult.csv in the example is derived from the UCI Machine Learning Repository (https://archive.ics.uci.edu/dataset/2/adult).

Pre-trained NBM

The pre-trained NBM should be placed in the pretrained_NBM/ folder, e.g., pretrained_NBM/adult_model_weights_NBM.pth.

Also, you can train a pre-trained NBM by setting the variable has_pretrained_NBM = False.

Run MONBM

Run MONBM training on Adult Dataset:

python MONBM_main.py -m
--config-path=config
--config-name=adult.yaml
+mode=local
hydra.sweep.dir=Result/adult_MONBM/
++datamodule.max_epochs=1000
++datamodule.batch_size=1024
++tabular_prediction_module.model=nbm_nw
++tabular_prediction_module='{learning_rate:0.025251432376859218,weight_decay:0.02234421165250452,
model_params:{nary:null,num_bases:100,hidden_dims:[256,128,128],num_subnets:1,dropout:0.0,
bases_dropout:0.05,batchnorm:True,output_penalty:0.002198283032140003}}'

Result

Results will be stored in the folder Result/dataset_name_NBM/0/start_running_time, e.g., Result/Adult_NBM/0/2024-10-10-10-20-31.

  • Chrom/ the NBM files of all the individuals
  • Objv_train.csv the objective values for all individuals in the training set
  • Objv_test.csv the objective values for all individuals in the test set

State

Part of the code for pre-training NBM is based on the "Neural Basis Models for Interpretability": (https://github.com/facebookresearch/nbm-spam).