Skip to content

Commit

Permalink
Code cleanup for MSL, PSM, SMAP and simulated datasets (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jad-yehya authored Nov 18, 2024
1 parent 4d01167 commit 1b6316d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
3 changes: 0 additions & 3 deletions datasets/msl.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@
class Dataset(BaseDataset):
name = "MSL"

install_cmd = "conda"
requirements = ["pandas", "requests"]

parameters = {
"debug": [False],
}
Expand Down
5 changes: 2 additions & 3 deletions datasets/psm.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@

class Dataset(BaseDataset):
name = "PSM"
install_cmd = "conda"
requirements = ["pandas"]

parameters = {
"debug": [False],
}
Expand All @@ -31,8 +30,8 @@ class Dataset(BaseDataset):
}

def get_data(self):
# Check if the data is already here
path = config.get_data_path(key="PSM")

# Check if the data is already here
if not path.exists():
path.mkdir(parents=True, exist_ok=True)
Expand Down
5 changes: 5 additions & 0 deletions datasets/simulated.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ class Dataset(BaseDataset):
}

def get_data(self):
# Simulated dataset created using scikit-learn
# We create a regression dataset with some anomalies

# Creating normal data
X_train, _ = make_regression(
n_samples=self.n_samples,
n_features=self.n_features,
Expand All @@ -40,6 +44,7 @@ def get_data(self):

assert X_test.shape == (self.n_samples, self.n_features)

# Adding anomalies
y_test = np.zeros(self.n_samples)
for i in range(self.n_anomaly):
idx = np.random.randint(self.n_samples)
Expand Down
3 changes: 0 additions & 3 deletions datasets/smap.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@
class Dataset(BaseDataset):
name = "SMAP"

install_cmd = "conda"
requirements = ["pandas", "scikit-learn"]

parameters = {
"debug": [False],
"n_splits": [5],
Expand Down

0 comments on commit 1b6316d

Please sign in to comment.