php-cs-fixer

This commit is contained in:
Arkadiusz Kondas 2016-06-17 00:34:15 +02:00
parent 424519cd83
commit 601ff884e8
8 changed files with 6 additions and 11 deletions

View File

@ -21,5 +21,4 @@ class NormalizerException extends \Exception
{
return new self('Fit is not allowed for this preprocessor.');
}
}

View File

@ -18,7 +18,7 @@ class TfIdfTransformer implements Transformer
*/
public function __construct(array $samples = null)
{
if($samples) {
if ($samples) {
$this->fit($samples);
}
}

View File

@ -92,7 +92,7 @@ class TokenCountVectorizer implements Transformer
foreach ($tokens as $token) {
$index = $this->getTokenIndex($token);
if(false !== $index) {
if (false !== $index) {
$this->updateFrequency($token);
if (!isset($counts[$index])) {
$counts[$index] = 0;

View File

@ -27,14 +27,14 @@ class Imputer implements Preprocessor
private $axis;
/**
* @var $samples
* @var
*/
private $samples;
/**
* @param mixed $missingValue
* @param Strategy $strategy
* @param int $axis
* @param mixed $missingValue
* @param Strategy $strategy
* @param int $axis
* @param array|null $samples
*/
public function __construct($missingValue = null, Strategy $strategy, int $axis = self::AXIS_COLUMN, array $samples = [])

View File

@ -6,7 +6,6 @@ namespace Phpml;
interface Transformer
{
/**
* @param array $samples
*/

View File

@ -78,7 +78,6 @@ class TokenCountVectorizerTest extends \PHPUnit_Framework_TestCase
$vectorizer->transform($samples);
$this->assertEquals($tokensCounts, $samples);
// word at least once in all samples
$samples = [
'Lorem ipsum dolor sit amet',

View File

@ -172,5 +172,4 @@ class ImputerTest extends \PHPUnit_Framework_TestCase
$this->assertEquals($imputeData, $data, '', $delta = 0.01);
}
}

View File

@ -79,5 +79,4 @@ class NormalizerTest extends \PHPUnit_Framework_TestCase
$this->assertEquals($normalized, $samples, '', $delta = 0.01);
}
}