Update dependencies and fix code styles (#334)

This commit is contained in:
Arkadiusz Kondas 2018-12-12 21:56:44 +01:00 committed by GitHub
parent db95db3e57
commit 1934d8af81
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 342 additions and 198 deletions

508
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -157,7 +157,7 @@ class Bagging implements Classifier
{
$predictions = [];
foreach ($this->classifiers as $classifier) {
/* @var $classifier Classifier */
/** @var Classifier $classifier */
$predictions[] = $classifier->predict($sample);
}

View File

@ -86,7 +86,7 @@ class RandomForest extends Bagging
// Traverse each tree and sum importance of the columns
$sum = [];
foreach ($this->classifiers as $tree) {
/* @var $tree DecisionTree */
/** @var DecisionTree $tree */
$importances = $tree->getFeatureImportances();
foreach ($importances as $column => $importance) {

View File

@ -18,7 +18,7 @@ class FuzzyCMeans implements Clusterer
private $clustersNumber;
/**
* @var array|Cluster[]
* @var Cluster[]
*/
private $clusters = [];
@ -28,7 +28,7 @@ class FuzzyCMeans implements Clusterer
private $space;
/**
* @var array|float[][]
* @var float[][]
*/
private $membership = [];

View File

@ -116,7 +116,7 @@ class Space extends SplObjectStorage
}
/**
* @return array|Cluster[]
* @return Cluster[]
*/
public function cluster(int $clustersNumber, int $initMethod = KMeans::INIT_RANDOM): array
{
@ -129,7 +129,7 @@ class Space extends SplObjectStorage
}
/**
* @return array|Cluster[]
* @return Cluster[]
*/
protected function initializeClusters(int $clustersNumber, int $initMethod): array
{

View File

@ -19,7 +19,7 @@ class StratifiedRandomSplit extends RandomSplit
}
/**
* @return Dataset[]|array
* @return Dataset[]
*/
private function splitByTarget(Dataset $dataset): array
{

View File

@ -17,9 +17,9 @@ final class ANOVA
* the same population mean. The test is applied to samples from two or
* more groups, possibly with differing sizes.
*
* @param array|array[] $samples - each row is class samples
* @param array[] $samples - each row is class samples
*
* @return array|float[]
* @return float[]
*/
public static function oneWayF(array $samples): array
{

View File

@ -9,8 +9,8 @@ use Phpml\Exception\InvalidArgumentException;
class Correlation
{
/**
* @param array|int[]|float[] $x
* @param array|int[]|float[] $y
* @param int[]|float[] $x
* @param int[]|float[] $y
*
* @throws InvalidArgumentException
*/

View File

@ -9,7 +9,7 @@ use Phpml\Exception\InvalidArgumentException;
class StandardDeviation
{
/**
* @param array|float[]|int[] $numbers
* @param float[]|int[] $numbers
*/
public static function population(array $numbers, bool $sample = true): float
{
@ -39,7 +39,7 @@ class StandardDeviation
* Sum of squares deviations
* ∑⟮xᵢ - μ⟯²
*
* @param array|float[]|int[] $numbers
* @param float[]|int[] $numbers
*/
public static function sumOfSquares(array $numbers): float
{

View File

@ -7,7 +7,7 @@ namespace Phpml;
class Pipeline implements Estimator
{
/**
* @var array|Transformer[]
* @var Transformer[]
*/
private $transformers = [];
@ -17,7 +17,7 @@ class Pipeline implements Estimator
private $estimator;
/**
* @param array|Transformer[] $transformers
* @param Transformer[] $transformers
*/
public function __construct(array $transformers, Estimator $estimator)
{
@ -39,7 +39,7 @@ class Pipeline implements Estimator
}
/**
* @return array|Transformer[]
* @return Transformer[]
*/
public function getTransformers(): array
{