-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.py
54 lines (27 loc) · 988 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# %%
import numpy as np
import pandas as pd
from pipelines.defaults import initialize_autoencoder, initialize_autoencoder_modified
from pipelines.defaults import dummy_data
pd.set_option("display.max_columns", None)
# from pyod.models.iforest import IForest
# from pyod.models.lof import LOF
from pyod.models.pca import PCA
from pipelines.control import AutoPrepAD
if __name__ == "__main__":
df_data = pd.read_csv("./temperature_USA.csv")
# clf_if = IForest(n_jobs=-1)
clf_pca = PCA()
# clf_ae = initialize_autoencoder_modified()
pipeline = AutoPrepAD()
pipeline.fit(
X_train=df_data,
clf=clf_pca,
dump_model=False,
)
X_output = pipeline.predict(X_test=df_data)
# X_output.to_csv("temperatures_anomalies.csv", index=False)
## Only Preprocessing of the Dataframe
# X_preprocess = pipeline.preprocess(df=df_data)
# anomaly_detection_pipeline.visualize_pipeline_structure_html()
# %%