-
Notifications
You must be signed in to change notification settings - Fork 232
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
ENH: Basic anomaly detector #393
base: master
Are you sure you want to change the base?
Conversation
uda/anomaly/anomaly.go
Outdated
pctChange := make([]float64, size-1) | ||
|
||
// pctChange = (a - b)/a | ||
// floats.SubTo(pctChange, columnData[1:], columnData[:size-1]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
todo: remove
if _, ok := a.AnomalyIdxsByColumn[epoch]; ok { | ||
previousValue = a.AnomalyIdxsByColumn[epoch] | ||
} | ||
a.AnomalyIdxsByColumn[epoch] = previousValue | 1<<columnNr |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If columnNr
is big enough (which seems very unlikely btw) then an overflow might occur.
import pymarketstore as pymkts | ||
|
||
# Constants | ||
DATA_TYPE_TICK = [('Epoch', 'i8'), ('Bid', 'f4'), ('Ask', 'f4'), ('Nanoseconds', 'i4')] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i4 is the right type for Nanoseconds, but later in the tests, all nanosec data are given as floats, so numpy trucates all of them to 0. I'm don't think it's causing much trouble, but better be on the safe side.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wow, we need to address that
813def9
to
bd8912c
Compare
Basic anomaly detector with Z-Score and Fixed Pct based detection for the
data columns in Marketstore. Can be used to spot price or volume outliers
in the ingested data.