justinengelmann / GANbasedOversampling

62 stars 12 forks source link

Final Year Project - issues running CWGAN on other datasets. #14

Open femurray opened 2 years ago

femurray commented 2 years ago

I am doing a final year project for my undergrad degree on Tabular GANs, and am hoping to do a comparative review (specifically regarding the use of tabular GANs on imbalanced data) as part of it.

So I am trying to use this GAN on 3 datasets. I am running into issues running all of them, and I'm not sure why. The issue for each is unique, i.e. if 1 dataset has an issue, the other 2 datasets don't trigger the issue and none of the datasets on this repo trigger these errors either. Would you have any insight into why these errors are occurring and be able to help me rectify them? The dataset sources are below.

creditcard: https://www.kaggle.com/mlg-ulb/creditcardfraud pendigits: https://archive.ics.uci.edu/ml/datasets/Pen-Based+Recognition+of+Handwritten+Digits intrusion: https://archive.ics.uci.edu/ml/datasets/kdd+cup+1999+data

I will include the error for each as comments here.

femurray commented 2 years ago

pendigits error:

Traceback (most recent call last):

File "C:\Users\ferga\AppData\Local\Temp/ipykernel_21824/1028949086.py", line 59, in gan.fit(X_train_trans, y=y_train.values,

File "C:\Users\ferga\Documents\College\FYP\python\cWGAN\models.py", line 313, in fit self.train(X=X_tens, y=y_tens, batch_size=batch_size, n_iters=n_iters, y_train=y_train)

File "C:\Users\ferga\Documents\College\FYP\python\cWGAN\models.py", line 328, in train self._pretrain_aux_classifier(X=X, y=y)

File "C:\Users\ferga\Documents\College\FYP\python\cWGAN\models.py", line 161, in _pretrain_aux_classifier f'AUC: {roc_auc_score(y[:, -1], preds):.4f} '

File "C:\Users\ferga\anaconda3\lib\site-packages\sklearn\utils\validation.py", line 63, in inner_f return f(*args, **kwargs)

File "C:\Users\ferga\anaconda3\lib\site-packages\sklearn\metrics_ranking.py", line 536, in roc_auc_score raise ValueError("multi_class must be in ('ovo', 'ovr')")

ValueError: multi_class must be in ('ovo', 'ovr')

justinengelmann commented 2 years ago

Hi, just saw this. The error you posted is due to your dataset having 10 classes, but the code is only setup for binary problems at the moment. In principle it can be adapted for multi-class but that would be a fair bit of effort.