pyculiarity icon indicating copy to clipboard operation
pyculiarity copied to clipboard

how do I plot the output as shown on the official R implementation

Open abhishekscript opened this issue 7 years ago • 1 comments

The code worked however I am not sure how do I plot something like this from the results

image

abhishekscript avatar May 15 '17 08:05 abhishekscript

from pyculiarity import detect_ts
import pandas as pd
twitter_example_data = pd.read_csv('raw_data.csv',
                                    usecols=['timestamp', 'count'])
results = detect_ts(twitter_example_data,
                    max_anoms=0.02,
                    direction='both')

plt.plot(twitter_example_data['timestamp'], twitter_example_data['value'])
plt.plot(results['anoms'].anoms, 'o')

nth-attempt avatar Sep 21 '17 23:09 nth-attempt