- Implementation of model building for regression
- New models of regression in the development
- There will be a separate thread for php 5.6
- composer dependency (Carbon DateTime, random-bytes)
-
= PHP 7.0
composer require robotomize/regression-php
Basic usage
$testData = [[0, 10], [1, 20], [2, 3], [3, 15], [4, 0]]
$linear = new LinearRegression();
$linear->setSourceSequence($testData);
$linear->calculate();
/** @var RegressionModel $regressionModel */
$regressionModel = $linear->getRegressionModel();
Factory usage
/** @var RegressionModel $regressionModel */
$regressionModel = Regression::Linear([[0, 10], [1, 20], [2, 3], [3, 15], [4, 0]]);
Basic usage
$exponential = new ExponentialRegression();
$exponential->setSourceSequence($testData);
$exponential->calculate();
$regressionModel = $exponential->getRegressionModel();
Factory usage
$regressionModel = Regression::Exponential($testData);
$logarithmic = new LogarithmicRegression();
$logarithmic->setSourceSequence($testData);
$logarithmic->calculate();
/** @var RegressionModel $regressionModel */
$regressionModel = $logarithmic->getRegressionModel();
$regressionModel = RegressionFactory::Logarithmic($testData);
$powerReg = new PowerRegression();
$powerReg->setSourceSequence($testData);
$powerReg->calculate();
/** @var RegressionModel $regressionModel */
$regressionModel = $powerReg->getRegressionModel();
$regressionModel = RegressionFactory::Power($testData);