Use absolute features when doing training/prediction. #11876
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Add a final step to the preprocessing of feature vectors to make them always be absolute values only. This follows on from some internal research showing the impact of this on the distance measure used to generate anomaly scores (illustrative colab notebook).
In below chart we add some contamination to the metric in last part of the chart.
Orange line below then shows impact of ensuring feature vectors are all absolute as opposed to allowing both positive and negative which can lead to a bias in distance measures of metics such as system.cpu that tend to randomly move up and down from second to second.
In this case the orange line behaves better as an anomaly score and jumps consistently in the period of contaminated data. Whereas the implementation that does not force absolute values actually performs worse. Essentially this is because allowing positive and negative values "naturally" suppresses distance measures since elements of the feature vector can essentially cancel each other out when you try to compare distances.
Component Name
area/ml
Test Plan
CI & verification with the ML team.