EnyanDai / GANF

Offical implementation of "Graph-Augmented Normalizing Flows for Anomaly Detection of Multiple Time Series" (ICLR 2022)
142 stars 24 forks source link

Bug in load_water #6

Open pratham16cse opened 2 years ago

pratham16cse commented 2 years ago

There is a bug in the load_water(..) function:

root = 'data/SWaT_Dataset_Attack_v0.csv'
data = pd.read_csv(root)
data = data.rename(columns={"Normal/Attack":"label"})
data.label[data.label!="Normal"]=1
data.label[data.label=="Normal"]=0
ts_format = pd.to_datetime(data["Timestamp"], format="%d/%m/%Y %I:%M:%S %p")
ts_no_format = pd.to_datetime(data["Timestamp"])

In the above code block, the dataframes ts_format and ts_no_format should be identical. However, since ts_no_format does not see the format, it treats the string 2/1/2016 7:00:00 AM as Feb 1st 2016 instead of the TRUE date Jan 2nd 2016.

The format specified in the format argument matches the format of the string timestamp. This can be easily verified by checking the format of any string timestamp with date >12.

Not sure how much this bug would affect the performance, but would be nice if the authors could fix it.

123smile456 commented 10 months ago

Hello, I modified this code running or reported an error, can you reply me? Thank you, the following is the code screenshot image image

1034 Line time format error. Other lines are correct