Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The BaseADDataset can not import #14

Open
Siesvan opened this issue Mar 16, 2023 · 1 comment
Open

The BaseADDataset can not import #14

Siesvan opened this issue Mar 16, 2023 · 1 comment

Comments

@Siesvan
Copy link

Siesvan commented Mar 16, 2023

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

@Minqi824
Copy link
Owner

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants