No project description provided
Project description
peshbeen
peshbeen is a easy-to-use Python library designed for time series forecasting. It provides a simple and intuitive interface for building, training, and evaluating forecasting models. It automatically handles data preprocessing specific to time series data, making it easier for users to focus on model development and evaluation. Peshbeen supports a variety of forecasting models, including traditional statistical models and modern machine learning approaches, including Linear Regression, Random Forest, XGBoost, LightGBM, CatBoost, and Cubist.
Why peshbeen
-
Automated Detrending Engine: Seamlessly handles non-stationary data using global linear trends, piecewise linear regression (for structural breaks), or ETS (Exponential Smoothing) to capture evolving trend dynamics.
-
Broad Model Support: Out-of-the-box compatibility with the leading tree-based and boosting architectures, including XGBoost, LightGBM, CatBoost, Random Forest, and AdaBoost.
-
Intelligent Optimization: Leverages Bayesian Optimization (Hyperopt) to not only tune machine learning hyperparameters but also to optimize smoothing parameters for ETS detrending.
-
Uncertainty Quantification: Goes beyond simple point forecasts with a suite of probabilistic approaches:
-
Empirical Distributions: Leveraged via boosting.
-
KDE (Kernel Density Estimation): For non-parametric forecast distribution modeling.
-
Correlated Error Modeling: Accounting for error dependencies across the forecast horizon.
-
Conformal Prediction: Distribution-free uncertainty estimates.
-
from peshbeen.datasets import load_wales_admissions
# split the data into train and test sets
train = load_wales_admissions[:-30]
test = load_wales_admissions[-30:]
from peshbeen.models import ml_forecaster
/Users/aslanm/Desktop/my_desk/peshbeen/.venv/lib/python3.13/site-packages/hyperopt/atpe.py:19: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.
import pkg_resources
# import linear regression from sklearn
from sklearn.linear_model import LinearRegression
ml_linear = ml_forecaster(model=LinearRegression(),
target_col='admissions', lags = 7)
ml_linear.fit(train)
ml_linear.forecast(H=30)
array([8837.64012317, 8809.61409562, 8800.56549201, 8808.3564168 ,
8831.16805604, 8837.29675557, 8834.15615162, 8824.03294077,
8813.03281712, 8805.24801163, 8805.10516068, 8807.59985417,
8809.44916909, 8808.68920192, 8805.40625265, 8800.62432546,
8796.6095056 , 8794.15334057, 8792.93850576, 8792.08382984,
8790.84528641, 8788.81540179, 8786.25136535, 8783.64463352,
8781.3601215 , 8779.47089754, 8777.8324959 , 8776.19551565,
8774.39826787, 8772.43408096])
# plot the forecast against the actual values
import matplotlib.pyplot as plt
plt.figure(figsize=(10, 6))
plt.plot(train.index[-90:], train['admissions'][-90:], label='Train')
plt.plot(test.index, test['admissions'], label='Test')
plt.plot(test.index, ml_linear.forecast(H=30), label='Forecast')
plt.legend()
plt.show()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file peshbeen-0.0.3.tar.gz.
File metadata
- Download URL: peshbeen-0.0.3.tar.gz
- Upload date:
- Size: 46.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
96e8fb4bbdc9457067d3888cbbd7dcc99eba29b777585e95e49c27d179dd4372
|
|
| MD5 |
2353a8cfd1b37ab375398d75a8d8d8a5
|
|
| BLAKE2b-256 |
7e436aaf28519be8f3e111258749fd6c95bb4f6c16adfd94096d0b246a8150d0
|
File details
Details for the file peshbeen-0.0.3-py3-none-any.whl.
File metadata
- Download URL: peshbeen-0.0.3-py3-none-any.whl
- Upload date:
- Size: 48.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c0fc07f3a8a5613ddbfa0441536a4d54cdaf97d399d1b13653668bb483be7f96
|
|
| MD5 |
9f6505f5ded6924d9fed1768365761e8
|
|
| BLAKE2b-256 |
8ab9e2221166874ef4b196769cdc729b3c0a07ca832dec603f039a0a40001bf9
|