Skip to content

Commit

Permalink
update to the latest version
Browse files Browse the repository at this point in the history
  • Loading branch information
Minqi824 committed Aug 5, 2022
1 parent acbe0e3 commit ca66910
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions data_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ def generator(self, X=None, y=None, minmax=True,
realistic_synthetic_mode=realistic_synthetic_mode,
alpha=alpha, percentage=percentage)
np.savez_compressed(os.path.join('datasets', 'synthetic', filepath), X=X, y=y)
pass

else:
X, y = self.generate_realistic_synthetic(X, y,
Expand Down
6 changes: 3 additions & 3 deletions run.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def __init__(self, suffix:str=None, mode:str='rla', parallel:str=None,
# dataset filter for delelting those datasets that do not satisfy the experimental requirement
def dataset_filter(self):
# dataset list in the current folder
dataset_list_org = [os.path.splitext(_)[0] for _ in os.listdir('datasets')]
dataset_list_org = [os.path.splitext(_)[0] for _ in os.listdir('datasets') if os.path.splitext(_)[1] in ['.npz', '.csv']]
dataset_list_org = [_ for _ in dataset_list_org if not _.split('_')[0].isdigit()]

dataset_list = []
Expand Down Expand Up @@ -160,7 +160,7 @@ def dataset_filter(self):

# remove high-dimensional CV and NLP datasets if generating synthetic anomalies or robustness test
if self.realistic_synthetic_mode is not None or self.noise_type is not None:
if any([_ in dataset for _ in ['CIFAR10, FashionMNIST', 'SVHN', 'agnews', 'amazon', 'imdb', 'yelp']]):
if self.isin_NLPCV(dataset):
add = False

if add:
Expand Down Expand Up @@ -310,5 +310,5 @@ def run(self):
df_time.to_csv(os.path.join(os.getcwd(), 'result', 'Time_' + self.suffix + '.csv'), index=True)

# run the above pipeline for reproducing the results in the paper
pipeline = RunPipeline(suffix='ADBench', parallel='unsupervise', realistic_synthetic_mode='dependency', noise_type=None)
pipeline = RunPipeline(suffix='ADBench', parallel='unsupervise', realistic_synthetic_mode='cluster', noise_type=None)
pipeline.run()

0 comments on commit ca66910

Please sign in to comment.