Skip to content

Commit

Permalink
Release
Browse files Browse the repository at this point in the history
  • Loading branch information
cerlymarco committed Sep 3, 2020
1 parent b9e34db commit ab076f8
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# tsmoothie

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

## Overview

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

The smoothing tecniques available are:
The smoothing techniques available are:

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

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

The interval types available are:

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

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

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.
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.

## Media

Blog Posts:

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

## Installation

Expand Down Expand Up @@ -119,5 +119,5 @@ for i in range(3):

## References

- 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)
- 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)
- Time Series Modelling with Unobserved Components, Matteo M. Pelagatti
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

HERE = pathlib.Path(__file__).parent

VERSION = '0.1.5'
VERSION = '0.1.6'
PACKAGE_NAME = 'tsmoothie'
AUTHOR = 'Marco Cerliani'
AUTHOR_EMAIL = '[email protected]'
Expand Down
2 changes: 1 addition & 1 deletion tsmoothie/smoother.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ def smooth(self, data):
if self.window_type == 'ones':
w = np.ones(self.window_len)
else:
w = eval('np.'+self.window_type+'(window_len)')
w = eval('np.'+self.window_type+'(self.window_len)')

if data.ndim == 2:
pad_data = np.pad(data, ((self.window_len,self.window_len),(0,0)), mode='symmetric')
Expand Down
6 changes: 3 additions & 3 deletions tsmoothie/utils_func.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ def create_windows(data, window_shape, step = 1, start_id = None, end_id = None)

data = np.asarray(data)

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

if window_shape < 1:
raise ValueError("window_shape must be >= 1")
Expand Down Expand Up @@ -196,7 +196,7 @@ def sigma_interval(true, prediction, n_sigma):
Upper bands.
"""

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

low = prediction - n_sigma*std
up = prediction + n_sigma*std
Expand Down

0 comments on commit ab076f8

Please sign in to comment.