mykolavuy/forecast
Composer 安装命令:
composer require mykolavuy/forecast
包简介
PHP library for linear, power, and logarithmic regression forecasting.
README 文档
README
A simple and extensible library for forecasting missing data points using different regression models: Linear, Power, Logarithmic, and Exponential. Designed for PHP 8.1+.
✨ Features
- 📊 Supports Linear, Power, Logarithmic, and Exponential regression.
- 🔍 Optional interpolation-only mode to avoid extrapolation.
- 🧩 Pluggable architecture via
RegressionInterface. - ⚡️ Fast, simple, and stateless static prediction:
ForecastService::predict($data, $method) - ✅ Thoroughly unit-tested.
📂 Source Code
The complete source code is available on GitHub.
🛠 Installation
composer require mykolavuy/forecast-regressions
🚀 Usage
use MykolaVuy\Forecast\ForecastService; $data = [ 1 => 10, 2 => null, 3 => 30, 4 => null, 5 => 50, 6 => null, ]; $service = new ForecastService(); // Linear regression forecast $result = $service->forecast($data, method: 'linear'); // Power regression with interpolation only $interpolated = $service->forecast($data, method: 'power', interpolateOnly: true); // 🔹 Static call (no instance needed) $static = ForecastService::predict($data, method: 'exponential');
🔧 Regression Methods
| Method | Formula | Description |
|---|---|---|
linear |
y = a * x + b | Straight-line fitting |
power |
y = a * x^b | Exponential-style growth/decay |
logarithmic |
y = a + b * log(x) | Logarithmic trend modeling |
exponential |
y = a * e^(b * x) | Classic exponential regression |
✅ Requirements
- PHP 8.1 or higher
- Composer
🧪 Running Tests
./vendor/bin/phpunit
Test files are located in the tests/ directory.
📄 License
This project is licensed under the MIT License.
🌐 Projects by the Author
intester.com
InTester is a secure and transparent online knowledge assessment platform. It offers time-limited tests, anti-cheating measures, instant results with PDF certificates, and public test records — making it ideal for job seekers and recruiters alike.
dctsign.com
DCT Sign is a blockchain-backed electronic signature platform that prioritizes privacy and data integrity. Users can securely sign documents without storing the original files, ensuring confidentiality and compliance with advanced e-signature standards.
Thank you for using ForecastRegressions! Contributions and feedback are welcome.
mykolavuy/forecast 适用场景与选型建议
mykolavuy/forecast 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 0 次下载、GitHub Stars 达 1, 最近一次更新时间为 2025 年 05 月 16 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 mykolavuy/forecast 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 mykolavuy/forecast 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 27
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-05-16