Skip to content

Commit ab076f8

Browse files
committed
Release
1 parent b9e34db commit ab076f8

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# tsmoothie
22

3-
A python library for timeseries smoothing and outlier detection in a vectorized way.
3+
A python library for time-series smoothing and outlier detection in a vectorized way.
44

55
## Overview
66

7-
tsmoothie computes, in a fast and efficient way, the smoothing of single or multiple timeseries.
7+
tsmoothie computes, in a fast and efficient way, the smoothing of single or multiple time-series.
88

9-
The smoothing tecniques available are:
9+
The smoothing techniques available are:
1010

1111
- Exponential Smoothing
1212
- Convolutional Smoothing with various window types (constant, hanning, hamming, bartlett, blackman)
@@ -17,7 +17,7 @@ The smoothing tecniques available are:
1717
- LOWESS
1818
- Kalman Smoothing with customizable components (level, trend, seasonality, long seasonality)
1919

20-
tsmoothie provides the calculation of intervals as result of the smoothing process. This can be useful to identify outliers and anomalies in timeseries.
20+
tsmoothie provides the calculation of intervals as result of the smoothing process. This can be useful to identify outliers and anomalies in time-series.
2121

2222
The interval types available are:
2323

@@ -28,14 +28,14 @@ The interval types available are:
2828

2929
The adoption of this type of intervals depends on the smoothing method used.
3030

31-
tsmoothie can also carry out a sliding smoothing approach. This is possible splitting the timeseries into equal sized pieces and smoothing them independently. As always, this functionality is implemented in a vectorized way through the WindowWrapper class.
31+
tsmoothie can also carry out a sliding smoothing approach. This is possible splitting the time-series into equal sized pieces and smoothing them independently. As always, this functionality is implemented in a vectorized way through the WindowWrapper class.
3232

3333
## Media
3434

3535
Blog Posts:
3636

37-
- Timeseries Smoothing for better clustering (cooming soon)
38-
- Timeseries Smoothing for better forecasting (cooming soon)
37+
- [Time Series Smoothing for better Clustering](https://towardsdatascience.com/time-series-smoothing-for-better-clustering-121b98f308e8)
38+
- Time Series Smoothing for better Forecasting (coming soon)
3939

4040
## Installation
4141

@@ -119,5 +119,5 @@ for i in range(3):
119119

120120
## References
121121

122-
- Polynomial, Spline, Gaussian and Binner smoothing are carried out building a regression on custom basis expansions. These implementations are based on the amazing intutions of Matthew Drury available [here](https://github.com/madrury/basis-expansions/blob/master/examples/comparison-of-smoothing-methods.ipynb)
122+
- Polynomial, Spline, Gaussian and Binner smoothing are carried out building a regression on custom basis expansions. These implementations are based on the amazing intuitions of Matthew Drury available [here](https://github.com/madrury/basis-expansions/blob/master/examples/comparison-of-smoothing-methods.ipynb)
123123
- Time Series Modelling with Unobserved Components, Matteo M. Pelagatti

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
HERE = pathlib.Path(__file__).parent
55

6-
VERSION = '0.1.5'
6+
VERSION = '0.1.6'
77
PACKAGE_NAME = 'tsmoothie'
88
AUTHOR = 'Marco Cerliani'
99
AUTHOR_EMAIL = '[email protected]'

tsmoothie/smoother.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ def smooth(self, data):
278278
if self.window_type == 'ones':
279279
w = np.ones(self.window_len)
280280
else:
281-
w = eval('np.'+self.window_type+'(window_len)')
281+
w = eval('np.'+self.window_type+'(self.window_len)')
282282

283283
if data.ndim == 2:
284284
pad_data = np.pad(data, ((self.window_len,self.window_len),(0,0)), mode='symmetric')

tsmoothie/utils_func.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,8 @@ def create_windows(data, window_shape, step = 1, start_id = None, end_id = None)
151151

152152
data = np.asarray(data)
153153

154-
if data.ndim == 0:
155-
raise ValueError("Pass an object with more than one timesteps")
154+
if data.ndim != 2:
155+
raise ValueError("Pass a 2D array-like in the format (timestemps, series)")
156156

157157
if window_shape < 1:
158158
raise ValueError("window_shape must be >= 1")
@@ -196,7 +196,7 @@ def sigma_interval(true, prediction, n_sigma):
196196
Upper bands.
197197
"""
198198

199-
std = (true - prediction).std(1, keepdims=True)
199+
std = np.nanstd(true - prediction, axis=1, keepdims=True)
200200

201201
low = prediction - n_sigma*std
202202
up = prediction + n_sigma*std

0 commit comments

Comments
 (0)