TSUtilities v0.0.2
Recent Changes
pip install TSUtilities:
pip install TSUtilities
Example of trend dampening:
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
sns.set_style('darkgrid')
y = np.linspace(0, 100, 100)
plt.plot(y)
plt.show()
y_train = y[:80]
future_y = y[80:]
future_trend = future_y
from TSUtilities.TSTrend.trend_dampen import TrendDampen
dampener = TrendDampen(damp_factor=.7,
damp_style='smooth')
dampened_trend = dampener.dampen(future_trend)
Example of Prophet Trend Dampening helper function where ts is your input to prophet:
from TSUtilities.functions import dampen_prophet
prophet = Prophet()
prophet.fit(ts)
fitted = prophet.predict()
# create a future data frame
future = prophet.make_future_dataframe(periods=len(y_test))
forecast = prophet.predict(future)
#get predictions and required data inputs for auto-damping
predictions = forecast.tail(len(y_test))
predicted_trend = predictions['trend'].values
trend_component = fitted['trend'].values
seasonality_component = fitted['additive_terms'].values
forecasts_no_dampen = predictions['yhat'].values
forecasts_damped = dampen_prophet(y=y.values,
fit_df=fitted,
forecast_df=forecast)
Metadata
Release files for TSUtilities 0.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| TSUtilities-0.0.5-py3-none-any.whl | Python 3 | none | any | Details |
Release files / TSUtilities-0.0.5-py3-none-any.whl
| Download URL | TSUtilities-0.0.5-py3-none-any.whl |
|---|---|
| Size | 11.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
db57afd25cb7e7757214445c98105c5575318c11f9a411ace5267ca503becb30
|
|
BLAKE2b-256 checksum How to use checksums |
f2ccd8244868f24dc0c2e90a21755ebac962128c5505cd1dca4139db973589e2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.7.15
|