-
Notifications
You must be signed in to change notification settings - Fork 145
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
Non-rigorous test score calculation #102
Comments
In what environment did you conduct the experiments? Could you share the versions of the setup? |
|
Did you encounter any issues during the run?for example index = broadcast(index, src, dim) |
Did you modify the code? Could you share a copy with me? Thank you very much! my email: [email protected] |
I can run the code as it is with the torch and torch_geometric versions mentioned above. It looks like a package version problem |
This environment cannot run on an RTX 4090 with CUDA 12.2. |
Hi @MengjieZhao, what parts of the code are you exactly talking about? Is it |
Yes, exactly. In the line of For the anomaly score calculation, one should take |
But why should we do this? At time of the calculation, the network has predicted the sensor values for each of the test time steps and we have measured the ground truth. Therefore, we can calculate their difference and smooth based on that. Then, we use the anomaly threshold calculated on the smoothed validation set error (https://github.com/d-ailin/GDN/blob/main/evaluate.py#L109) and make the prediction on the smoothed test set error. |
From the nature of the task of anomaly detection, one would like to have the prediction in real time, and in real time, one only has the test data until the observed time. Using the statistics from the entire test dataset makes applying the model practically useless. |
Ah okay, I understand that reason! But then we should use the statistics from the train and validation set combined, because they are our measure for normality. |
One has to account for the generalization error as well, since the anomaly score is based on the forecasting error, that of the training set will naturally be lower. |
Good point, tanks for the insight! How big is your validation set? Maybe it did not cover enough of the data distribution. |
In the test score calculation, the authors use the test distribution to scale the test score per node. This is not a common practice for anomaly detection as the test statistics are usually unknown at the time of evaluation.
I refactored the code to use the statistics of the validation set to scale both the validation score and test score, however, there is a huge performance drop, as shown in the attached screenshot. The blue one is the original implementation with the test score scaled by the test distribution. The purple one is scaled by the validation statistics. The black one is first scaled by the first 1000 test samples' statistics (roughly 1/9), generally increased to 8/9, but there is almost no change in terms of the f1 performance. The final jump of the black line occurred because I changed to use the entire test statistics instead of 8/9.
The problem persists with the ROC-AUC as well, with the test score scaled by the validation statistics, the AUC is around 0.52 for the best epoch.
This work is the foundation of many GNN for time series papers, I urge attention to this issue.
The text was updated successfully, but these errors were encountered: