# forecast
[![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
## Overview
forecast is a Python library built upon the foundation of the sktime library, designed to simplify and streamline the process of forecasting and prediction model aggregation. It provides tools for aggregating predictions from multiple models, evaluating their performance, and visualizing the results. Whether you're working on time series forecasting, data analysis, or any other predictive modeling task, forecast offers a convenient and efficient way to handle aggregation and comparison.
## Key Features
- **Model Aggregation:** Easily aggregate predictions from multiple models using various aggregation modes such as best model overall, best model per horizon, inverse score weighted average model, and more.
- **Out-of-Sample Evaluation:** Evaluate model performance using out-of-sample data and choose the best models based on user-defined performance metrics.
- **Visualization:** Visualize model performance, aggregated predictions, and prediction intervals with built-in plotting functions.
- **Flexibility:** Accommodate various aggregation strategies, forecast horizons, and performance metrics to cater to your specific use case.
## Installation
Install Your Package Name using pip:
```bash
pip install forecast
```
## Usage
```python
# Import the necessary classes from your-package-name
data = pd.Series(np.cumsum(np.random.normal(0, 1, size=1000)),
index=pd.date_range(end='31/12/2022', periods=1000)).rename('y').to_frame()
from forecast.model_select import ForecastModelSelect
ForecastingModels = {
"Naive": NaiveForecaster(),
"AutoARIMA": StatsForecastAutoARIMA(),
"AutoETS": StatsForecastAutoETS(),
"AutoTheta": StatsForecastAutoTheta(),
"TBATS": TBATS(),
"Prophet": Prophet(),
}
model = ForecastModelSelect(
data= data,
depvar_str = 'y',
exog_l=None,
fh = 10,
pct_initial_window=0.75,
step_length = 25,
models_d = ForecastingModels,
freq = 'B',
mode = 'nbest_average_horizon',
score = 'RMSE',
nbest = 2)
# compare models
model.select_best(score = 'MAPE')
# Visualize model comparison
model.plot_model_compare(score='MAPE', view='horizon')
model.plot_model_compare(score='MAPE', view='cutoff')
# Generate prediction
y_pred, y_pred_ints, preds, pred_ints = model.predict(score='RMSE', ret_underlying=True)
# Visualize prediction
LFMS.plot_prediction(y_pred = y_pred,
models_preds = preds,
y_pred_interval = y_pred_ints,
title = 'Prediction')
```
## Documentation
For detailed information about available classes, methods, and parameters, please refer to the [Documentation](https://amineraboun.github.io/forecast/).
## License
This project is licensed under the [MIT License](LICENSE).
## Contributing
We welcome contributions from the community! If you have suggestions, bug reports, or feature requests, please open an issue or submit a pull request.
## Contact
For queries, support, or general inquiries, please feel free to reach me at [amineraboun@gmail.com](mailto:amineraboun@gmail.com).
Raw data
{
"_id": null,
"home_page": "https://github.com/amineraboun/forecast",
"name": "forecast-ar",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8,<3.12",
"maintainer_email": "",
"keywords": "arima,ets,theta,tbats,prophet",
"author": "amineraboun",
"author_email": "amineraboun@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/3e/a1/3a8d4512a467e9f0c4db605e9071accc73110106b0e06ba21de2747cb740/forecast_ar-0.0.1.tar.gz",
"platform": null,
"description": "# forecast\n\n[![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n\n## Overview\n\nforecast is a Python library built upon the foundation of the sktime library, designed to simplify and streamline the process of forecasting and prediction model aggregation. It provides tools for aggregating predictions from multiple models, evaluating their performance, and visualizing the results. Whether you're working on time series forecasting, data analysis, or any other predictive modeling task, forecast offers a convenient and efficient way to handle aggregation and comparison.\n\n## Key Features\n\n- **Model Aggregation:** Easily aggregate predictions from multiple models using various aggregation modes such as best model overall, best model per horizon, inverse score weighted average model, and more.\n- **Out-of-Sample Evaluation:** Evaluate model performance using out-of-sample data and choose the best models based on user-defined performance metrics.\n- **Visualization:** Visualize model performance, aggregated predictions, and prediction intervals with built-in plotting functions.\n- **Flexibility:** Accommodate various aggregation strategies, forecast horizons, and performance metrics to cater to your specific use case.\n\n## Installation\n\nInstall Your Package Name using pip:\n\n```bash\npip install forecast\n```\n\n## Usage\n\n```python\n# Import the necessary classes from your-package-name\ndata = pd.Series(np.cumsum(np.random.normal(0, 1, size=1000)), \n index=pd.date_range(end='31/12/2022', periods=1000)).rename('y').to_frame()\n\nfrom forecast.model_select import ForecastModelSelect\nForecastingModels = {\n\"Naive\": NaiveForecaster(),\n\"AutoARIMA\": StatsForecastAutoARIMA(),\n\"AutoETS\": StatsForecastAutoETS(),\n\"AutoTheta\": StatsForecastAutoTheta(),\n\"TBATS\": TBATS(),\n\"Prophet\": Prophet(),\n}\nmodel = ForecastModelSelect(\n data= data,\n depvar_str = 'y', \n exog_l=None,\n fh = 10,\n pct_initial_window=0.75,\n step_length = 25,\n models_d = ForecastingModels,\n freq = 'B',\n mode = 'nbest_average_horizon',\n score = 'RMSE', \n nbest = 2)\n\n# compare models\nmodel.select_best(score = 'MAPE')\n# Visualize model comparison\nmodel.plot_model_compare(score='MAPE', view='horizon')\nmodel.plot_model_compare(score='MAPE', view='cutoff')\n\n# Generate prediction\ny_pred, y_pred_ints, preds, pred_ints = model.predict(score='RMSE', ret_underlying=True)\n\n# Visualize prediction\nLFMS.plot_prediction(y_pred = y_pred,\n models_preds = preds,\n y_pred_interval = y_pred_ints, \n title = 'Prediction')\n```\n\n## Documentation\n\nFor detailed information about available classes, methods, and parameters, please refer to the [Documentation](https://amineraboun.github.io/forecast/).\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE).\n\n## Contributing\n\nWe welcome contributions from the community! If you have suggestions, bug reports, or feature requests, please open an issue or submit a pull request. \n\n## Contact\n\nFor queries, support, or general inquiries, please feel free to reach me at [amineraboun@gmail.com](mailto:amineraboun@gmail.com).\n",
"bugtrack_url": null,
"license": "",
"summary": "Automation of forecast models testing, combining and predicting",
"version": "0.0.1",
"project_urls": {
"Homepage": "https://github.com/amineraboun/forecast",
"Repository": "https://github.com/amineraboun/forecast"
},
"split_keywords": [
"arima",
"ets",
"theta",
"tbats",
"prophet"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "333c1d70fd88c4fc0751f078dafba80f1a74a989c408d0c766c07118af421cf0",
"md5": "674ab749456f4e25a83b260cbdb49b85",
"sha256": "571428e456bf5d31f856797ea6f443539ab37a25186a82ca3845f0e9040be30d"
},
"downloads": -1,
"filename": "forecast_ar-0.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "674ab749456f4e25a83b260cbdb49b85",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8,<3.12",
"size": 19746,
"upload_time": "2023-08-10T15:18:29",
"upload_time_iso_8601": "2023-08-10T15:18:29.276132Z",
"url": "https://files.pythonhosted.org/packages/33/3c/1d70fd88c4fc0751f078dafba80f1a74a989c408d0c766c07118af421cf0/forecast_ar-0.0.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "3ea13a8d4512a467e9f0c4db605e9071accc73110106b0e06ba21de2747cb740",
"md5": "5a3bc13bc51ae79ffd8a44782c3beb00",
"sha256": "23411688a14ca47f9d448e48a00166a813a05da86fe67657333cecf0057e0304"
},
"downloads": -1,
"filename": "forecast_ar-0.0.1.tar.gz",
"has_sig": false,
"md5_digest": "5a3bc13bc51ae79ffd8a44782c3beb00",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8,<3.12",
"size": 19993,
"upload_time": "2023-08-10T15:18:31",
"upload_time_iso_8601": "2023-08-10T15:18:31.061115Z",
"url": "https://files.pythonhosted.org/packages/3e/a1/3a8d4512a467e9f0c4db605e9071accc73110106b0e06ba21de2747cb740/forecast_ar-0.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-08-10 15:18:31",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "amineraboun",
"github_project": "forecast",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "forecast-ar"
}