Minqi824/ADBench

The BaseADDataset can not import

Siesvan opened this issue · 1 comments

Hello, when I run deepsad.py, there's an error that BaseADDataset cannot import, but two weeks ago it can be imported. May the problem is that package's version is outdated?
Thank you for providing help!
mmexport1679003636153

I sincerely apologize for my late reply. We have released the latest version of ADBench. See the following codes for install or upgrade ADBench package.

pip install adbench
pip install --upgrade adbench

The following is an example to run DeepSAD on the cardio dataset (The dataset needs to be downloaded first, see the guidance for downloading datasets)

from adbench.datasets.data_generator import DataGenerator
# load cardio dataset w.r.t. the ratio of labeled anomalies=0.05
data_generator = DataGenerator(seed=42, dataset='6_cardio')
data = data_generator.generator(la=0.05)


# load DeepSAD
from adbench.baseline.DeepSAD.src.run import DeepSAD
model = DeepSAD(seed=42)
model.fit(X_train=data['X_train'], y_train=data['y_train'])
score_test = model.predict_score(X=data['X_test'])
print(score_test)