forecaster-ai 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,20 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Forecasting Package Team
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+ The above copyright notice and this permission notice shall be included in all
12
+ copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ SOFTWARE.
@@ -0,0 +1,458 @@
1
+ Metadata-Version: 2.4
2
+ Name: forecaster-ai
3
+ Version: 0.1.0
4
+ Summary: Enterprise-grade time series forecasting package with ARIMA, Prophet, and LSTM models
5
+ Author-email: Surya Tripathi <suryaec1099@gmail.com>
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/surya08084/forecaster-ai
8
+ Project-URL: Documentation, https://forecasting-package.readthedocs.io
9
+ Project-URL: Repository, https://github.com/surya08084/forecaster-ai
10
+ Project-URL: Bug Tracker, https://github.com/surya08084/forecaster-ai/issues
11
+ Keywords: forecasting,time-series,machine-learning,arima,prophet,lstm,mlops
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Intended Audience :: Science/Research
15
+ Classifier: License :: OSI Approved :: MIT License
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.9
18
+ Classifier: Programming Language :: Python :: 3.10
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
21
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
22
+ Requires-Python: >=3.9
23
+ Description-Content-Type: text/markdown
24
+ License-File: LICENSE
25
+ Requires-Dist: numpy>=1.24.0
26
+ Requires-Dist: pandas>=2.0.0
27
+ Requires-Dist: scikit-learn>=1.3.0
28
+ Requires-Dist: statsmodels>=0.14.0
29
+ Requires-Dist: prophet>=1.1.0
30
+ Requires-Dist: torch>=2.0.0
31
+ Requires-Dist: pydantic>=2.0.0
32
+ Requires-Dist: fastapi>=0.100.0
33
+ Requires-Dist: uvicorn[standard]>=0.23.0
34
+ Requires-Dist: mlflow>=2.5.0
35
+ Requires-Dist: optuna>=3.3.0
36
+ Requires-Dist: pyyaml>=6.0
37
+ Requires-Dist: python-dateutil>=2.8.0
38
+ Requires-Dist: holidays>=0.30
39
+ Requires-Dist: matplotlib>=3.7.0
40
+ Requires-Dist: seaborn>=0.12.0
41
+ Requires-Dist: scipy>=1.11.0
42
+ Requires-Dist: prometheus-client>=0.17.0
43
+ Requires-Dist: python-multipart>=0.0.6
44
+ Provides-Extra: dev
45
+ Requires-Dist: pytest>=7.4.0; extra == "dev"
46
+ Requires-Dist: pytest-cov>=4.1.0; extra == "dev"
47
+ Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
48
+ Requires-Dist: black>=23.7.0; extra == "dev"
49
+ Requires-Dist: ruff>=0.0.280; extra == "dev"
50
+ Requires-Dist: mypy>=1.4.0; extra == "dev"
51
+ Requires-Dist: pre-commit>=3.3.0; extra == "dev"
52
+ Requires-Dist: ipython>=8.14.0; extra == "dev"
53
+ Requires-Dist: jupyter>=1.0.0; extra == "dev"
54
+ Requires-Dist: notebook>=7.0.0; extra == "dev"
55
+ Provides-Extra: docs
56
+ Requires-Dist: mkdocs>=1.5.0; extra == "docs"
57
+ Requires-Dist: mkdocs-material>=9.1.0; extra == "docs"
58
+ Requires-Dist: mkdocstrings[python]>=0.22.0; extra == "docs"
59
+ Provides-Extra: all
60
+ Requires-Dist: forecasting[dev,docs]; extra == "all"
61
+ Dynamic: license-file
62
+
63
+ # Forecasting Package πŸ“ˆ
64
+
65
+ [![CI](https://github.com/username/forecasting-package/workflows/CI/badge.svg)](https://github.com/username/forecasting-package/actions)
66
+ [![codecov](https://codecov.io/gh/username/forecasting-package/branch/main/graph/badge.svg)](https://codecov.io/gh/username/forecasting-package)
67
+ [![PyPI version](https://badge.fury.io/py/forecasting-package.svg)](https://badge.fury.io/py/forecasting-package)
68
+ [![Python 3.9+](https://img.shields.io/badge/python-3.9+-blue.svg)](https://www.python.org/downloads/)
69
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
70
+ [![Documentation](https://img.shields.io/badge/docs-latest-brightgreen.svg)](https://docs.forecasting-package.example.com)
71
+
72
+ An enterprise-grade time series forecasting package with MLOps capabilities, supporting multiple forecasting models, automated hyperparameter tuning, and production-ready deployment.
73
+
74
+ ## ✨ Features
75
+
76
+ ### 🎯 Core Capabilities
77
+ - **Multiple Forecasting Models**: ARIMA, Prophet, LSTM, and Ensemble methods
78
+ - **Automated Model Selection**: AutoML with hyperparameter optimization
79
+ - **Data Validation**: Comprehensive data quality checks and preprocessing
80
+ - **Feature Engineering**: Automated temporal and Fourier feature generation
81
+ - **Evaluation Framework**: Backtesting, cross-validation, and comprehensive metrics
82
+
83
+ ### πŸš€ MLOps Integration
84
+ - **Experiment Tracking**: MLflow integration for experiment management
85
+ - **Model Registry**: Version control and model lifecycle management
86
+ - **Performance Monitoring**: Real-time model performance and drift detection
87
+ - **A/B Testing**: Compare multiple models in production
88
+
89
+ ### 🌐 Production Ready
90
+ - **REST API**: FastAPI-based prediction and training endpoints
91
+ - **Docker Support**: Containerized deployment with docker-compose
92
+ - **CI/CD Pipeline**: Automated testing, building, and deployment
93
+ - **Monitoring**: Prometheus and Grafana integration
94
+ - **Scalability**: Horizontal scaling support
95
+
96
+ ## πŸ“¦ Installation
97
+
98
+ ### Using pip
99
+
100
+ ```bash
101
+ pip install forecasting-package
102
+ ```
103
+
104
+ ### From source
105
+
106
+ ```bash
107
+ git clone https://github.com/username/forecasting-package.git
108
+ cd forecasting-package
109
+ pip install -e .
110
+ ```
111
+
112
+ ### Using Docker
113
+
114
+ ```bash
115
+ docker pull ghcr.io/username/forecasting-package:latest
116
+ docker run -p 8000:8000 ghcr.io/username/forecasting-package:latest
117
+ ```
118
+
119
+ ## πŸš€ Quick Start
120
+
121
+ ### Basic Usage
122
+
123
+ ```python
124
+ import pandas as pd
125
+ from forecasting.models.arima import ARIMAForecaster
126
+ from forecasting.data.validators import TimeSeriesValidator
127
+ from forecasting.evaluation.metrics import ForecastMetrics
128
+
129
+ # Load your time series data
130
+ df = pd.read_csv('data.csv', parse_dates=['date'])
131
+
132
+ # Validate data
133
+ validator = TimeSeriesValidator()
134
+ is_valid, issues = validator.validate(df['value'])
135
+
136
+ # Create and train model
137
+ model = ARIMAForecaster(order=(1, 1, 1))
138
+ model.fit(df['value'].values)
139
+
140
+ # Make predictions
141
+ forecast = model.predict(steps=30)
142
+
143
+ # Evaluate
144
+ metrics = ForecastMetrics()
145
+ mae = metrics.mae(df['value'][-30:], forecast)
146
+ print(f"MAE: {mae}")
147
+ ```
148
+
149
+ ### Using Prophet
150
+
151
+ ```python
152
+ from forecasting.models.prophet import ProphetForecaster
153
+
154
+ # Create Prophet model with custom seasonality
155
+ model = ProphetForecaster(
156
+ seasonality_mode='multiplicative',
157
+ yearly_seasonality=True,
158
+ weekly_seasonality=True
159
+ )
160
+
161
+ # Fit with exogenous variables
162
+ model.fit(
163
+ y=df['value'].values,
164
+ dates=df['date'].values,
165
+ exog=df[['temperature', 'holiday']].values
166
+ )
167
+
168
+ # Forecast with confidence intervals
169
+ forecast, lower, upper = model.predict(steps=30, return_conf_int=True)
170
+ ```
171
+
172
+ ### Using LSTM
173
+
174
+ ```python
175
+ from forecasting.models.lstm import LSTMForecaster
176
+
177
+ # Create LSTM model
178
+ model = LSTMForecaster(
179
+ hidden_size=64,
180
+ num_layers=2,
181
+ dropout=0.2,
182
+ learning_rate=0.001
183
+ )
184
+
185
+ # Train model
186
+ model.fit(
187
+ y=df['value'].values,
188
+ epochs=100,
189
+ batch_size=32,
190
+ validation_split=0.2
191
+ )
192
+
193
+ # Predict
194
+ forecast = model.predict(steps=30)
195
+ ```
196
+
197
+ ### Ensemble Methods
198
+
199
+ ```python
200
+ from forecasting.models.ensemble import EnsembleForecaster
201
+ from forecasting.models.arima import ARIMAForecaster
202
+ from forecasting.models.prophet import ProphetForecaster
203
+
204
+ # Create ensemble
205
+ ensemble = EnsembleForecaster(
206
+ models=[
207
+ ARIMAForecaster(order=(1, 1, 1)),
208
+ ProphetForecaster()
209
+ ],
210
+ weights=[0.6, 0.4] # Optional custom weights
211
+ )
212
+
213
+ # Train and predict
214
+ ensemble.fit(df['value'].values)
215
+ forecast = ensemble.predict(steps=30)
216
+ ```
217
+
218
+ ### AutoML
219
+
220
+ ```python
221
+ from forecasting.models.tuning import AutoML
222
+
223
+ # Automated model selection and tuning
224
+ automl = AutoML(
225
+ models=['arima', 'prophet', 'lstm'],
226
+ metric='rmse',
227
+ cv_folds=5
228
+ )
229
+
230
+ # Find best model
231
+ best_model = automl.fit(df['value'].values)
232
+
233
+ # Use best model
234
+ forecast = best_model.predict(steps=30)
235
+ ```
236
+
237
+ ## πŸ”§ Advanced Usage
238
+
239
+ ### Data Preprocessing
240
+
241
+ ```python
242
+ from forecasting.data.preprocessors import TimeSeriesPreprocessor
243
+ from forecasting.data.feature_engineering import FeatureEngineer
244
+
245
+ # Preprocess data
246
+ preprocessor = TimeSeriesPreprocessor()
247
+ df_clean = preprocessor.handle_missing_values(df)
248
+ df_scaled, scaler = preprocessor.scale_data(df_clean)
249
+
250
+ # Engineer features
251
+ engineer = FeatureEngineer()
252
+ df_features = engineer.create_temporal_features(df_scaled)
253
+ df_features = engineer.create_fourier_features(df_features, n_terms=3)
254
+ ```
255
+
256
+ ### Backtesting
257
+
258
+ ```python
259
+ from forecasting.evaluation.backtesting import RollingOriginBacktester
260
+
261
+ # Setup backtester
262
+ backtester = RollingOriginBacktester(
263
+ initial_window=100,
264
+ horizon=10,
265
+ step=1
266
+ )
267
+
268
+ # Run backtest
269
+ results = backtester.run(model, df['value'].values)
270
+
271
+ # Analyze results
272
+ print(f"Average RMSE: {results['avg_rmse']}")
273
+ print(f"Average MAE: {results['avg_mae']}")
274
+ ```
275
+
276
+ ### MLflow Integration
277
+
278
+ ```python
279
+ from forecasting.mlops.tracking import ExperimentTracker
280
+ from forecasting.mlops.registry import ModelRegistry
281
+
282
+ # Track experiments
283
+ tracker = ExperimentTracker(
284
+ experiment_name='sales_forecasting',
285
+ tracking_uri='http://localhost:5000'
286
+ )
287
+
288
+ with tracker.start_run():
289
+ # Train model
290
+ model.fit(df['value'].values)
291
+
292
+ # Log parameters
293
+ tracker.log_params({'order': (1, 1, 1)})
294
+
295
+ # Log metrics
296
+ tracker.log_metrics({'rmse': 10.5, 'mae': 8.2})
297
+
298
+ # Log model
299
+ tracker.log_model(model, 'arima_model')
300
+
301
+ # Register model
302
+ registry = ModelRegistry(tracking_uri='http://localhost:5000')
303
+ version = registry.register_model(
304
+ model_name='sales_forecaster',
305
+ model=model,
306
+ metadata={'dataset': 'sales_2024'}
307
+ )
308
+ ```
309
+
310
+ ## 🌐 API Usage
311
+
312
+ ### Start API Server
313
+
314
+ ```bash
315
+ # Using uvicorn
316
+ uvicorn forecasting.api.main:app --host 0.0.0.0 --port 8000
317
+
318
+ # Using Docker
319
+ docker-compose up -d
320
+ ```
321
+
322
+ ### Make Predictions
323
+
324
+ ```python
325
+ import requests
326
+
327
+ # Predict endpoint
328
+ response = requests.post(
329
+ 'http://localhost:8000/api/v1/predict',
330
+ json={
331
+ 'model_name': 'sales_forecaster',
332
+ 'steps': 30,
333
+ 'confidence_level': 0.95
334
+ }
335
+ )
336
+
337
+ forecast = response.json()
338
+ print(forecast['predictions'])
339
+ ```
340
+
341
+ ### Train Model via API
342
+
343
+ ```python
344
+ # Training endpoint
345
+ response = requests.post(
346
+ 'http://localhost:8000/api/v1/train',
347
+ json={
348
+ 'model_type': 'arima',
349
+ 'data': data_list,
350
+ 'config': {
351
+ 'order': [1, 1, 1],
352
+ 'seasonal_order': [0, 0, 0, 0]
353
+ }
354
+ }
355
+ )
356
+
357
+ result = response.json()
358
+ print(f"Model trained: {result['model_id']}")
359
+ ```
360
+
361
+ ## πŸ“Š Monitoring
362
+
363
+ ### Prometheus Metrics
364
+
365
+ The API exposes metrics at `/metrics`:
366
+
367
+ - `forecast_requests_total`: Total prediction requests
368
+ - `forecast_request_duration_seconds`: Request duration
369
+ - `model_prediction_errors_total`: Prediction errors
370
+ - `active_models`: Number of active models
371
+
372
+ ### Grafana Dashboards
373
+
374
+ Access Grafana at `http://localhost:3000` (default credentials: admin/admin)
375
+
376
+ Pre-configured dashboards:
377
+ - Model Performance Overview
378
+ - API Request Metrics
379
+ - System Resource Usage
380
+ - Model Drift Detection
381
+
382
+ ## πŸ§ͺ Testing
383
+
384
+ ```bash
385
+ # Run all tests
386
+ make test
387
+
388
+ # Run with coverage
389
+ make test-coverage
390
+
391
+ # Run specific test suite
392
+ pytest tests/unit/test_models.py -v
393
+
394
+ # Run integration tests
395
+ pytest tests/integration/ -v
396
+ ```
397
+
398
+ ## πŸ“š Documentation
399
+
400
+ Full documentation is available at [https://docs.forecasting-package.example.com](https://docs.forecasting-package.example.com)
401
+
402
+ - [User Guide](https://docs.forecasting-package.example.com/user-guide/)
403
+ - [API Reference](https://docs.forecasting-package.example.com/api/)
404
+ - [Examples](https://docs.forecasting-package.example.com/examples/)
405
+ - [Contributing Guide](https://docs.forecasting-package.example.com/contributing/)
406
+
407
+ ## 🀝 Contributing
408
+
409
+ We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.
410
+
411
+ ```bash
412
+ # Setup development environment
413
+ make install-dev
414
+
415
+ # Run pre-commit checks
416
+ make pre-commit
417
+
418
+ # Submit pull request
419
+ git checkout -b feature/your-feature
420
+ git commit -m "Add your feature"
421
+ git push origin feature/your-feature
422
+ ```
423
+
424
+ ## πŸ“„ License
425
+
426
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
427
+
428
+ ## πŸ™ Acknowledgments
429
+
430
+ - [Prophet](https://facebook.github.io/prophet/) by Facebook
431
+ - [statsmodels](https://www.statsmodels.org/) for ARIMA implementation
432
+ - [PyTorch](https://pytorch.org/) for LSTM models
433
+ - [MLflow](https://mlflow.org/) for experiment tracking
434
+ - [FastAPI](https://fastapi.tiangolo.com/) for API framework
435
+
436
+ ## πŸ“ž Support
437
+
438
+ - πŸ“§ Email: support@forecasting-package.example.com
439
+ - πŸ’¬ Slack: [Join our community](https://slack.forecasting-package.example.com)
440
+ - πŸ› Issues: [GitHub Issues](https://github.com/username/forecasting-package/issues)
441
+ - πŸ“– Docs: [Documentation](https://docs.forecasting-package.example.com)
442
+
443
+ ## πŸ—ΊοΈ Roadmap
444
+
445
+ - [ ] Support for additional models (XGBoost, LightGBM)
446
+ - [ ] Real-time streaming predictions
447
+ - [ ] Automated anomaly detection
448
+ - [ ] Multi-variate forecasting
449
+ - [ ] Cloud deployment templates (AWS, GCP, Azure)
450
+ - [ ] Web UI for model management
451
+
452
+ ## ⭐ Star History
453
+
454
+ [![Star History Chart](https://api.star-history.com/svg?repos=username/forecasting-package&type=Date)](https://star-history.com/#username/forecasting-package&Date)
455
+
456
+ ---
457
+
458
+ Made with ❀️ by the Forecasting Package Team