Update php-cs-fixer

This commit is contained in:
Arkadiusz Kondas 2016-11-20 22:53:17 +01:00
parent bca2196b57
commit cbdc049526
139 changed files with 160 additions and 159 deletions

View File

@ -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

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml\Association;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml\Association;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml\Classification;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml\Classification;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml\Classification;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml\Classification;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml\Clustering;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml\Clustering;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml\Clustering;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml\Clustering\KMeans;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml\Clustering\KMeans;
@ -46,7 +46,7 @@ class Point implements ArrayAccess
$distance = 0;
for ($n = 0; $n < $this->dimension; ++$n) {
$difference = $this->coordinates[$n] - $point->coordinates[$n];
$distance += $difference * $difference;
$distance += $difference * $difference;
}
return $precise ? sqrt((float) $distance) : $distance;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml\Clustering\KMeans;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml\CrossValidation;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml\CrossValidation;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml\CrossValidation;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml\Dataset;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml\Dataset;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml\Dataset;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml\Dataset\Demo;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml\Dataset\Demo;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml\Dataset\Demo;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml\Dataset;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml\Exception;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml\Exception;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml\Exception;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml\Exception;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml\FeatureExtraction;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml\FeatureExtraction\StopWords;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml\FeatureExtraction\StopWords;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml\FeatureExtraction;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml\FeatureExtraction;
@ -173,7 +173,7 @@ class TokenCountVectorizer implements Transformer
/**
* @param array $samples
*
*
* @return array
*/
private function checkDocumentFrequency(array &$samples)

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml\Helper;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml\Helper;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml\Math;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml\Math\Distance;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml\Math\Distance;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml\Math\Distance;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml\Math\Distance;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml\Math;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml\Math\Kernel;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml\Math;
@ -113,7 +113,7 @@ class Matrix
/**
* @return float|int
*
*
* @throws MatrixException
*/
public function getDeterminant()

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml\Math;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml\Math;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml\Math\Statistic;
@ -30,7 +30,7 @@ class Correlation
$a2 = 0;
$b2 = 0;
for ($i = 0;$i < $count;++$i) {
for ($i = 0; $i < $count; ++$i) {
$a = $x[$i] - $meanX;
$b = $y[$i] - $meanY;
$axb = $axb + ($a * $b);

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml\Math\Statistic;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml\Math\Statistic;
@ -33,7 +33,7 @@ class StandardDeviation
foreach ($a as $val) {
$d = $val - $mean;
$carry += $d * $d;
};
}
if ($sample) {
--$n;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml\Metric;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml\Metric;
@ -113,7 +113,7 @@ class ClassificationReport
{
foreach (['precision', 'recall', 'f1score'] as $metric) {
$values = array_filter($this->$metric);
if(0==count($values)) {
if (0 == count($values)) {
$this->average[$metric] = 0.0;
continue;
}

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml\Metric;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml\NeuralNetwork;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml\NeuralNetwork\ActivationFunction;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml\NeuralNetwork\ActivationFunction;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml\NeuralNetwork\ActivationFunction;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml\NeuralNetwork\ActivationFunction;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml\NeuralNetwork;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml\NeuralNetwork;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml\NeuralNetwork\Network;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml\NeuralNetwork\Network;
@ -64,7 +64,7 @@ class MultilayerPerceptron extends LayeredNetwork
private function addBiasNodes()
{
$biasLayers = count($this->layers) - 1;
for ($i = 0;$i < $biasLayers;++$i) {
for ($i = 0; $i < $biasLayers; ++$i) {
$this->layers[$i]->addNode(new Bias());
}
}

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml\NeuralNetwork;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml\NeuralNetwork\Node;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml\NeuralNetwork\Node;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml\NeuralNetwork\Node;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml\NeuralNetwork\Node\Neuron;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml\NeuralNetwork;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml\NeuralNetwork\Training;
@ -126,7 +126,7 @@ class Backpropagation implements Training
/**
* @param Neuron $neuron
*
*
* @return float
*/
private function getPrevSigma(Neuron $neuron): float

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml\NeuralNetwork\Training\Backpropagation;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml;
@ -20,7 +20,7 @@ class Pipeline implements Estimator
* @param array|Transformer[] $transformers
* @param Estimator $estimator
*/
public function __construct(array $transformers = [], Estimator $estimator)
public function __construct(array $transformers, Estimator $estimator)
{
foreach ($transformers as $transformer) {
$this->addTransformer($transformer);

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml\Preprocessing;
@ -37,7 +37,7 @@ class Imputer implements Preprocessor
* @param int $axis
* @param array|null $samples
*/
public function __construct($missingValue = null, Strategy $strategy, int $axis = self::AXIS_COLUMN, array $samples = [])
public function __construct($missingValue, Strategy $strategy, int $axis = self::AXIS_COLUMN, array $samples = [])
{
$this->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

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml\Preprocessing\Imputer;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml\Preprocessing\Imputer\Strategy;
@ -11,7 +11,7 @@ class MeanStrategy implements Strategy
{
/**
* @param array $currentAxis
*
*
* @return float
*/
public function replaceValue(array $currentAxis)

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml\Preprocessing\Imputer\Strategy;
@ -11,7 +11,7 @@ class MedianStrategy implements Strategy
{
/**
* @param array $currentAxis
*
*
* @return float
*/
public function replaceValue(array $currentAxis)

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml\Preprocessing\Imputer\Strategy;
@ -11,7 +11,7 @@ class MostFrequentStrategy implements Strategy
{
/**
* @param array $currentAxis
*
*
* @return float|mixed
*/
public function replaceValue(array $currentAxis)

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml\Preprocessing;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml\Preprocessing;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml\Regression;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml\Regression;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml\Regression;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml\Regression;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml\SupportVectorMachine;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml\SupportVectorMachine;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml\SupportVectorMachine;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml\SupportVectorMachine;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml\Tokenization;
@ -8,7 +8,7 @@ interface Tokenizer
{
/**
* @param string $text
*
*
* @return array
*/
public function tokenize(string $text): array;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml\Tokenization;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml\Tokenization;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace Phpml;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace tests\Classification;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace tests\Classification;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace tests\Classification;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace tests\Classification;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace tests\Clustering;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace tests\Clustering;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace tests\Phpml\CrossValidation;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace tests\Phpml\CrossValidation;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace tests\Phpml\Dataset;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace tests\Phpml\Dataset;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace tests\Phpml\Dataset\Demo;

View File

@ -1,6 +1,6 @@
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace tests\Phpml\Dataset\Demo;

Some files were not shown because too many files have changed in this diff Show More