Marcnuth / AnomalyDetection

Twitter's Anomaly Detection in Pure Python
Apache License 2.0
304 stars 76 forks source link

Plot Function Additoin + Bug Fixes - Remove Assert due to Codacy #34

Closed aliasgherman closed 4 years ago

aliasgherman commented 4 years ago
A plot function has been added. the function only takes the data and the anomaly return dict to generate a simple plot and return to user in the dict.

When using pandas dataframes as data, and dtype was int64, it was generating error in the block where dtype is checked against int and float. So I added a check against 'int64' as well

For the cases where the datetime have gaps in the middle, the code would take data which sometimes will be less than the num_obs_samples due to break and will generate assertions. I have handled it by ignoring the samples wherever this condition is not met. This is a debatable approach, however, this does remove the assertion errors as other anomalies are still detected.
aliasgherman commented 4 years ago

Codacy is asking me to remove all whitespaces :) Closing this as well.