mirror of
https://github.com/Llewellynvdm/php-ml.git
synced 2024-11-22 21:15:10 +00:00
replace mean calls
This commit is contained in:
parent
80a712e8a8
commit
52cbda0482
@ -23,8 +23,8 @@ class Correlation
|
||||
}
|
||||
|
||||
$count = count($x);
|
||||
$meanX = array_sum($x) / $count;
|
||||
$meanY = array_sum($y) / $count;
|
||||
$meanX = Mean::arithmetic($x);
|
||||
$meanY = Mean::arithmetic($y);
|
||||
|
||||
$axb = 0;
|
||||
$a2 = 0;
|
||||
|
@ -28,7 +28,7 @@ class StandardDeviation
|
||||
throw InvalidArgumentException::arraySizeToSmall(2);
|
||||
}
|
||||
|
||||
$mean = array_sum($a) / $n;
|
||||
$mean = Mean::arithmetic($a);
|
||||
$carry = 0.0;
|
||||
foreach ($a as $val) {
|
||||
$d = $val - $mean;
|
||||
|
Loading…
Reference in New Issue
Block a user