Skip to main content

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)

Table of built distributions (wheels) for TSUtilities 0.0.5
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

This release

0.0.5 This release

1 release file

0.0.3

1 release file

0.0.2

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page