Unverified Commit 1934d8af authored by Arkadiusz Kondas's avatar Arkadiusz Kondas Committed by GitHub
Browse files

Update dependencies and fix code styles (#334)

parent db95db3e
This diff is collapsed.
......@@ -157,7 +157,7 @@ class Bagging implements Classifier
{
$predictions = [];
foreach ($this->classifiers as $classifier) {
/* @var $classifier Classifier */
/** @var Classifier $classifier */
$predictions[] = $classifier->predict($sample);
}
......
......@@ -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) {
......
......@@ -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 = [];
......
......@@ -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
{
......
......@@ -19,7 +19,7 @@ class StratifiedRandomSplit extends RandomSplit
}
/**
* @return Dataset[]|array
* @return Dataset[]
*/
private function splitByTarget(Dataset $dataset): array
{
......
......@@ -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
{
......
......@@ -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
*/
......
......@@ -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
{
......
......@@ -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
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment