# 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)
```
Raw data
{
"_id": null,
"home_page": "https://github.com/tblume1992/TSUtilities",
"name": "TSUtilities",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "forecasting,time series,seasonality,trend",
"author": "Tyler Blume",
"author_email": "tblume@mail.USF.edu",
"download_url": "",
"platform": null,
"description": "# TSUtilities v0.0.2\n\n## Recent Changes\n\npip install TSUtilities:\n```\npip install TSUtilities\n```\n\nExample of trend dampening:\n\n```\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nimport numpy as np\n\nsns.set_style('darkgrid')\ny = np.linspace(0, 100, 100)\nplt.plot(y)\nplt.show()\n\ny_train = y[:80]\nfuture_y = y[80:]\nfuture_trend = future_y\n\n\nfrom TSUtilities.TSTrend.trend_dampen import TrendDampen\n\ndampener = TrendDampen(damp_factor=.7,\n damp_style='smooth')\ndampened_trend = dampener.dampen(future_trend)\n```\n\nExample of Prophet Trend Dampening helper function where ts is your input to prophet:\n\n```\nfrom TSUtilities.functions import dampen_prophet\n\nprophet = Prophet()\nprophet.fit(ts)\nfitted = prophet.predict()\n\n# create a future data frame\nfuture = prophet.make_future_dataframe(periods=len(y_test))\nforecast = prophet.predict(future)\n\n#get predictions and required data inputs for auto-damping\npredictions = forecast.tail(len(y_test))\npredicted_trend = predictions['trend'].values\ntrend_component = fitted['trend'].values\nseasonality_component = fitted['additive_terms'].values\nforecasts_no_dampen = predictions['yhat'].values\nforecasts_damped = dampen_prophet(y=y.values,\n fit_df=fitted,\n forecast_df=forecast)\n```\n",
"bugtrack_url": null,
"license": "",
"summary": "Various utilities for time series forecasting.",
"version": "0.0.2",
"split_keywords": [
"forecasting",
"time series",
"seasonality",
"trend"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "595a5bbda093a004a9b455f54b40f8b8054cc698c12b1809fdda92ff13030496",
"md5": "279db5aca849478581128569f7e4480d",
"sha256": "00158e456079212048b931ca2182a642bf9bd4ac6064b13d03f7f5a5289fb06b"
},
"downloads": -1,
"filename": "TSUtilities-0.0.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "279db5aca849478581128569f7e4480d",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 6847,
"upload_time": "2023-01-24T15:59:42",
"upload_time_iso_8601": "2023-01-24T15:59:42.918959Z",
"url": "https://files.pythonhosted.org/packages/59/5a/5bbda093a004a9b455f54b40f8b8054cc698c12b1809fdda92ff13030496/TSUtilities-0.0.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-01-24 15:59:42",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "tblume1992",
"github_project": "TSUtilities",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "tsutilities"
}