Skip to content

Commit

Permalink
Update dependencies and fix code styles (#334)
Browse files Browse the repository at this point in the history
  • Loading branch information
akondas authored Dec 12, 2018
1 parent db95db3 commit 1934d8a
Show file tree
Hide file tree
Showing 10 changed files with 338 additions and 194 deletions.
500 changes: 322 additions & 178 deletions composer.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/Classification/Ensemble/Bagging.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ protected function predictSample(array $sample)
{
$predictions = [];
foreach ($this->classifiers as $classifier) {
/* @var $classifier Classifier */
/** @var Classifier $classifier */
$predictions[] = $classifier->predict($sample);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Classification/Ensemble/RandomForest.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public function getFeatureImportances(): array
// 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) {
Expand Down
4 changes: 2 additions & 2 deletions src/Clustering/FuzzyCMeans.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class FuzzyCMeans implements Clusterer
private $clustersNumber;

/**
* @var array|Cluster[]
* @var Cluster[]
*/
private $clusters = [];

Expand All @@ -28,7 +28,7 @@ class FuzzyCMeans implements Clusterer
private $space;

/**
* @var array|float[][]
* @var float[][]
*/
private $membership = [];

Expand Down
4 changes: 2 additions & 2 deletions src/Clustering/KMeans/Space.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public function getRandomPoint(Point $min, Point $max): Point
}

/**
* @return array|Cluster[]
* @return Cluster[]
*/
public function cluster(int $clustersNumber, int $initMethod = KMeans::INIT_RANDOM): array
{
Expand All @@ -129,7 +129,7 @@ public function cluster(int $clustersNumber, int $initMethod = KMeans::INIT_RAND
}

/**
* @return array|Cluster[]
* @return Cluster[]
*/
protected function initializeClusters(int $clustersNumber, int $initMethod): array
{
Expand Down
2 changes: 1 addition & 1 deletion src/CrossValidation/StratifiedRandomSplit.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ protected function splitDataset(Dataset $dataset, float $testSize): void
}

/**
* @return Dataset[]|array
* @return Dataset[]
*/
private function splitByTarget(Dataset $dataset): array
{
Expand Down
4 changes: 2 additions & 2 deletions src/Math/Statistic/ANOVA.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
4 changes: 2 additions & 2 deletions src/Math/Statistic/Correlation.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
class Correlation
{
/**
* @param array|int[]|float[] $x
* @param array|int[]|float[] $y
* @param int[]|float[] $x
* @param int[]|float[] $y
*
* @throws InvalidArgumentException
*/
Expand Down
4 changes: 2 additions & 2 deletions src/Math/Statistic/StandardDeviation.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
class StandardDeviation
{
/**
* @param array|float[]|int[] $numbers
* @param float[]|int[] $numbers
*/
public static function population(array $numbers, bool $sample = true): float
{
Expand Down Expand Up @@ -39,7 +39,7 @@ public static function population(array $numbers, bool $sample = true): float
* Sum of squares deviations
* ∑⟮xᵢ - μ⟯²
*
* @param array|float[]|int[] $numbers
* @param float[]|int[] $numbers
*/
public static function sumOfSquares(array $numbers): float
{
Expand Down
6 changes: 3 additions & 3 deletions src/Pipeline.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
class Pipeline implements Estimator
{
/**
* @var array|Transformer[]
* @var Transformer[]
*/
private $transformers = [];

Expand All @@ -17,7 +17,7 @@ class Pipeline implements Estimator
private $estimator;

/**
* @param array|Transformer[] $transformers
* @param Transformer[] $transformers
*/
public function __construct(array $transformers, Estimator $estimator)
{
Expand All @@ -39,7 +39,7 @@ public function setEstimator(Estimator $estimator): void
}

/**
* @return array|Transformer[]
* @return Transformer[]
*/
public function getTransformers(): array
{
Expand Down

0 comments on commit 1934d8a

Please sign in to comment.