diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c8f2ae..781d5fd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,8 +3,10 @@ CHANGELOG This changelog references the relevant changes done in PHP-ML library. -* 0.2.1 (in plan/progress) +* 0.2.2 (in plan/progress) * feature [Regression] - SSE, SSTo, SSR - sum of the squared + +* 0.2.1 (2016-11-20) * feature [Association] - Apriori algorithm implementation * bug [Metric] - division by zero diff --git a/src/Phpml/Association/Apriori.php b/src/Phpml/Association/Apriori.php index bec1510..4855691 100644 --- a/src/Phpml/Association/Apriori.php +++ b/src/Phpml/Association/Apriori.php @@ -1,6 +1,6 @@ dimension; ++$n) { $difference = $this->coordinates[$n] - $point->coordinates[$n]; - $distance += $difference * $difference; + $distance += $difference * $difference; } return $precise ? sqrt((float) $distance) : $distance; diff --git a/src/Phpml/Clustering/KMeans/Space.php b/src/Phpml/Clustering/KMeans/Space.php index 89a0d09..40b1f1d 100644 --- a/src/Phpml/Clustering/KMeans/Space.php +++ b/src/Phpml/Clustering/KMeans/Space.php @@ -1,6 +1,6 @@ $metric); - if(0==count($values)) { + if (0 == count($values)) { $this->average[$metric] = 0.0; continue; } diff --git a/src/Phpml/Metric/ConfusionMatrix.php b/src/Phpml/Metric/ConfusionMatrix.php index 6aeaa87..664e355 100644 --- a/src/Phpml/Metric/ConfusionMatrix.php +++ b/src/Phpml/Metric/ConfusionMatrix.php @@ -1,6 +1,6 @@ layers) - 1; - for ($i = 0;$i < $biasLayers;++$i) { + for ($i = 0; $i < $biasLayers; ++$i) { $this->layers[$i]->addNode(new Bias()); } } diff --git a/src/Phpml/NeuralNetwork/Node.php b/src/Phpml/NeuralNetwork/Node.php index 77e0c00..65d5cdc 100644 --- a/src/Phpml/NeuralNetwork/Node.php +++ b/src/Phpml/NeuralNetwork/Node.php @@ -1,6 +1,6 @@ addTransformer($transformer); diff --git a/src/Phpml/Preprocessing/Imputer.php b/src/Phpml/Preprocessing/Imputer.php index 012bb79..805d3f6 100644 --- a/src/Phpml/Preprocessing/Imputer.php +++ b/src/Phpml/Preprocessing/Imputer.php @@ -1,6 +1,6 @@ missingValue = $missingValue; $this->strategy = $strategy; @@ -78,7 +78,7 @@ class Imputer implements Preprocessor /** * @param int $column * @param array $currentSample - * + * * @return array */ private function getAxis(int $column, array $currentSample): array diff --git a/src/Phpml/Preprocessing/Imputer/Strategy.php b/src/Phpml/Preprocessing/Imputer/Strategy.php index 2cf1144..9125e06 100644 --- a/src/Phpml/Preprocessing/Imputer/Strategy.php +++ b/src/Phpml/Preprocessing/Imputer/Strategy.php @@ -1,6 +1,6 @@ assertEquals([ 'precision' => 0, 'recall' => 0, - 'f1score' => 0 + 'f1score' => 0, ], $report->getAverage(), '', 0.01); } - } diff --git a/tests/Phpml/Metric/ConfusionMatrixTest.php b/tests/Phpml/Metric/ConfusionMatrixTest.php index d133ae2..1b2782b 100644 --- a/tests/Phpml/Metric/ConfusionMatrixTest.php +++ b/tests/Phpml/Metric/ConfusionMatrixTest.php @@ -1,6 +1,6 @@