@@ -3,8 +3,6 @@ |
||
3 | 3 | |
4 | 4 | namespace Regression; |
5 | 5 | |
6 | -use Carbon\Carbon; |
|
7 | - |
|
8 | 6 | /** |
9 | 7 | * Class ExponentialRegression |
10 | 8 | * @package Regression |
@@ -58,7 +58,7 @@ |
||
58 | 58 | $this->resultSequence[] = $coordinate; |
59 | 59 | } |
60 | 60 | |
61 | - $this->equation = 'y = ' . round($A, 2) . '+ e^(' . round($B, 2) . 'x)'; |
|
61 | + $this->equation = 'y = ' . round($A, 2) . '+ e^(' . round($B, 2) . 'x)'; |
|
62 | 62 | |
63 | 63 | $this->push(); |
64 | 64 | } |
@@ -3,10 +3,6 @@ |
||
3 | 3 | |
4 | 4 | namespace Regression; |
5 | 5 | |
6 | -use Carbon\Carbon; |
|
7 | -use Exception; |
|
8 | -use IllegalArgumentException; |
|
9 | - |
|
10 | 6 | /** |
11 | 7 | * Class LinearRegression |
12 | 8 | * @package Regression |
@@ -60,7 +60,7 @@ |
||
60 | 60 | $this->resultSequence[] = $coordinate; |
61 | 61 | } |
62 | 62 | |
63 | - $this->equation = 'y = ' . round($gradient, 1) . 'x + ' . round($intercept, 1); |
|
63 | + $this->equation = 'y = ' . round($gradient, 1) . 'x + ' . round($intercept, 1); |
|
64 | 64 | |
65 | 65 | $this->push(); |
66 | 66 | } |
@@ -47,14 +47,14 @@ |
||
47 | 47 | $B = ($k * $this->sumIndex[1] - $this->sumIndex[2] * $this->sumIndex[0]) |
48 | 48 | / ($k * $this->sumIndex[3] - $this->sumIndex[0] * $this->sumIndex[0]); |
49 | 49 | |
50 | - $A = exp(($this->sumIndex[2] - $B * $this->sumIndex[0])/ $k); |
|
50 | + $A = exp(($this->sumIndex[2] - $B * $this->sumIndex[0]) / $k); |
|
51 | 51 | |
52 | 52 | foreach ($this->sourceSequence as $i => $val) { |
53 | 53 | $coordinate = [$val[0], $A * exp($B * $val[0])]; |
54 | 54 | $this->resultSequence[] = $coordinate; |
55 | 55 | } |
56 | 56 | |
57 | - $this->equation = 'y = ' . round($A, 2) . '+ x^' . round($B, 2); |
|
57 | + $this->equation = 'y = ' . round($A, 2) . '+ x^' . round($B, 2); |
|
58 | 58 | |
59 | 59 | $this->push(); |
60 | 60 | } |
@@ -1,7 +1,7 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | spl_autoload_register( |
4 | - function ($className) { |
|
4 | + function($className) { |
|
5 | 5 | $className = ltrim($className, '\\'); |
6 | 6 | $fileName = ''; |
7 | 7 | if ($lastNsPos = strripos($className, '\\')) { |