Minimal tensorflow
re-implementation for the framework in Generating Customer's Credit Behavior with Deep Generative Models: paper. If you are interested in the original code (implemented in Theano), contact me.
If you use this code in your research, please cite:
@article{mancisidor2022generating,
title={Generating Customer's Credit Behavior with Deep Generative Models},
author={Mancisidor, Rogelio A and Kampffmeyer, Michael and Aas, Kjersti and Jenssen, Robert},
journal={Knowledge-Based Systems},
pages={108568},
doi = {10.1016/j.knosys.2022.108568},
year={2022},
publisher={Elsevier}
}
The code for CBMD is developed in tensorflow==2.7.0
. It is possible to log model training with weights & biases
, you just need to add your user name when training the model. In addition to tensorflow==2.7.0
and wandb==0.12.7
, you need to dowload the following libraries: numpy==1.21.3
, sklearn==1.0.1
, and matplotlib==3.5.0
.
The structure of the project should look like this:
cbmd
│───data
│───output
│───python
Otherwise you will get error messages when loading the data, saving figures etc.
The application data can be obtanied here and the behavior data here.
The original data can be obtanied from here. In this other version, the features are sorted according with their predictive power in ascending order, i.e. first column is the least predictive feature, while last column is the most predictive feature as explained in the paper.
Make sure the requirements are satisfied in your environment, and relevant datasets are downloaded. cd
into python
, and run
python -u train_cbmd.py
to train the CBMD model with the LC dataset.
See the file running_specs.sh
for details about input parameters for the SAN dataset.
You can play with the hyperparameters using arguments, e.g.:
--omega
: Parameter for MI optimization--lambda_val
: Scaling parameter for the KL loss--zdim
: dimension of the latent variable
For all arguments see all add_argument()
functions in train_cbmd.py