diff --git a/src/Phpml/Classification/DecisionTree.php b/src/Phpml/Classification/DecisionTree.php index c8e8674..f99b032 100644 --- a/src/Phpml/Classification/DecisionTree.php +++ b/src/Phpml/Classification/DecisionTree.php @@ -72,10 +72,6 @@ class DecisionTree implements Classifier $this->maxDepth = $maxDepth; } - /** - * @param array $samples - * @param array $targets - */ public function train(array $samples, array $targets) { $this->samples = array_merge($this->samples, $samples); @@ -104,11 +100,6 @@ class DecisionTree implements Classifier } } - /** - * @param array $samples - * - * @return array - */ public static function getColumnTypes(array $samples) : array { $types = []; @@ -122,10 +113,6 @@ class DecisionTree implements Classifier return $types; } - /** - * @param array $records - * @param int $depth - */ protected function getSplitLeaf(array $records, int $depth = 0) : DecisionTreeLeaf { $split = $this->getBestSplit($records); @@ -239,8 +226,6 @@ class DecisionTree implements Classifier * * If any of above methods were not called beforehand, then all features * are returned by default. - * - * @return array */ protected function getSelectedFeatures() : array { @@ -296,11 +281,6 @@ class DecisionTree implements Classifier return array_sum($giniParts) / count($colValues); } - /** - * @param array $samples - * - * @return array - */ protected function preprocess(array $samples) : array { // Detect and convert continuous data column values into @@ -325,9 +305,6 @@ class DecisionTree implements Classifier return array_map(null, ...$columns); } - /** - * @param array $columnValues - */ protected static function isCategoricalColumn(array $columnValues) : bool { $count = count($columnValues); diff --git a/src/Phpml/Classification/Linear/Adaline.php b/src/Phpml/Classification/Linear/Adaline.php index bcc014e..2a649ad 100644 --- a/src/Phpml/Classification/Linear/Adaline.php +++ b/src/Phpml/Classification/Linear/Adaline.php @@ -52,7 +52,6 @@ class Adaline extends Perceptron /** * Adapts the weights with respect to given samples and targets * by use of gradient descent learning rule - * @param array $targets */ protected function runTraining(array $samples, array $targets) { diff --git a/src/Phpml/Classification/Linear/LogisticRegression.php b/src/Phpml/Classification/Linear/LogisticRegression.php index bd100ba..bfbeb44 100644 --- a/src/Phpml/Classification/Linear/LogisticRegression.php +++ b/src/Phpml/Classification/Linear/LogisticRegression.php @@ -138,9 +138,6 @@ class LogisticRegression extends Adaline /** * Executes Conjugate Gradient method to optimize the weights of the LogReg model - * - * @param array $samples - * @param array $targets */ protected function runConjugateGradient(array $samples, array $targets, \Closure $gradientFunc) { diff --git a/src/Phpml/Classification/WeightedClassifier.php b/src/Phpml/Classification/WeightedClassifier.php index 4af3de4..0a5f192 100644 --- a/src/Phpml/Classification/WeightedClassifier.php +++ b/src/Phpml/Classification/WeightedClassifier.php @@ -13,8 +13,6 @@ abstract class WeightedClassifier implements Classifier /** * Sets the array including a weight for each sample - * - * @param array $weights */ public function setSampleWeights(array $weights) { diff --git a/src/Phpml/Dataset/ArrayDataset.php b/src/Phpml/Dataset/ArrayDataset.php index 96feec7..e27b2e3 100644 --- a/src/Phpml/Dataset/ArrayDataset.php +++ b/src/Phpml/Dataset/ArrayDataset.php @@ -19,9 +19,6 @@ class ArrayDataset implements Dataset protected $targets = []; /** - * @param array $samples - * @param array $targets - * * @throws InvalidArgumentException */ public function __construct(array $samples, array $targets) @@ -34,17 +31,11 @@ class ArrayDataset implements Dataset $this->targets = $targets; } - /** - * @return array - */ public function getSamples() : array { return $this->samples; } - /** - * @return array - */ public function getTargets() : array { return $this->targets; diff --git a/src/Phpml/DimensionReduction/EigenTransformerBase.php b/src/Phpml/DimensionReduction/EigenTransformerBase.php index 913148b..df18d11 100644 --- a/src/Phpml/DimensionReduction/EigenTransformerBase.php +++ b/src/Phpml/DimensionReduction/EigenTransformerBase.php @@ -47,8 +47,6 @@ abstract class EigenTransformerBase * Calculates eigenValues and eigenVectors of the given matrix. Returns * top eigenVectors along with the largest eigenValues. The total explained variance * of these eigenVectors will be no less than desired $totalVariance value - * - * @param array $matrix */ protected function eigenDecomposition(array $matrix) { @@ -85,10 +83,6 @@ abstract class EigenTransformerBase /** * Returns the reduced data - * - * @param array $data - * - * @return array */ protected function reduce(array $data) : array { diff --git a/src/Phpml/FeatureExtraction/TfIdfTransformer.php b/src/Phpml/FeatureExtraction/TfIdfTransformer.php index 61f7e65..c5e1e59 100644 --- a/src/Phpml/FeatureExtraction/TfIdfTransformer.php +++ b/src/Phpml/FeatureExtraction/TfIdfTransformer.php @@ -13,9 +13,6 @@ class TfIdfTransformer implements Transformer */ private $idf; - /** - * @param array $samples - */ public function __construct(array $samples = null) { if ($samples) { @@ -23,9 +20,6 @@ class TfIdfTransformer implements Transformer } } - /** - * @param array $samples - */ public function fit(array $samples) { $this->countTokensFrequency($samples); @@ -36,9 +30,6 @@ class TfIdfTransformer implements Transformer } } - /** - * @param array $samples - */ public function transform(array &$samples) { foreach ($samples as &$sample) { @@ -48,9 +39,6 @@ class TfIdfTransformer implements Transformer } } - /** - * @param array $samples - */ private function countTokensFrequency(array $samples) { $this->idf = array_fill_keys(array_keys($samples[0]), 0); diff --git a/src/Phpml/Helper/Optimizer/ConjugateGradient.php b/src/Phpml/Helper/Optimizer/ConjugateGradient.php index 994971d..7333b9a 100644 --- a/src/Phpml/Helper/Optimizer/ConjugateGradient.php +++ b/src/Phpml/Helper/Optimizer/ConjugateGradient.php @@ -17,12 +17,6 @@ namespace Phpml\Helper\Optimizer; */ class ConjugateGradient extends GD { - /** - * @param array $samples - * @param array $targets - * - * @return array - */ public function runOptimization(array $samples, array $targets, \Closure $gradientCb) : array { $this->samples = $samples; diff --git a/src/Phpml/Math/LinearAlgebra/EigenvalueDecomposition.php b/src/Phpml/Math/LinearAlgebra/EigenvalueDecomposition.php index d24b1a9..b76ddb9 100644 --- a/src/Phpml/Math/LinearAlgebra/EigenvalueDecomposition.php +++ b/src/Phpml/Math/LinearAlgebra/EigenvalueDecomposition.php @@ -2,7 +2,6 @@ declare(strict_types=1); /** - * * Class to obtain eigenvalues and eigenvectors of a real matrix. * * If A is symmetric, then A = V*D*V' where the eigenvalue matrix D @@ -88,8 +87,6 @@ class EigenvalueDecomposition /** * Constructor: Check for symmetry, then construct the eigenvalue decomposition - * - * @param array $Arg */ public function __construct(array $Arg) { diff --git a/src/Phpml/Math/Product.php b/src/Phpml/Math/Product.php index 35ef79c..ab1e75a 100644 --- a/src/Phpml/Math/Product.php +++ b/src/Phpml/Math/Product.php @@ -7,9 +7,6 @@ namespace Phpml\Math; class Product { /** - * @param array $a - * @param array $b - * * @return mixed */ public static function scalar(array $a, array $b) diff --git a/src/Phpml/Math/Statistic/Mean.php b/src/Phpml/Math/Statistic/Mean.php index 22cd4bb..50b3788 100644 --- a/src/Phpml/Math/Statistic/Mean.php +++ b/src/Phpml/Math/Statistic/Mean.php @@ -9,8 +9,6 @@ use Phpml\Exception\InvalidArgumentException; class Mean { /** - * @param array $numbers - * * @throws InvalidArgumentException */ public static function arithmetic(array $numbers) : float @@ -21,8 +19,6 @@ class Mean } /** - * @param array $numbers - * * @return float|mixed * * @throws InvalidArgumentException @@ -44,8 +40,6 @@ class Mean } /** - * @param array $numbers - * * @return mixed * * @throws InvalidArgumentException @@ -60,8 +54,6 @@ class Mean } /** - * @param array $array - * * @throws InvalidArgumentException */ private static function checkArrayLength(array $array) diff --git a/src/Phpml/Metric/Accuracy.php b/src/Phpml/Metric/Accuracy.php index 3dfcb34..3fd545c 100644 --- a/src/Phpml/Metric/Accuracy.php +++ b/src/Phpml/Metric/Accuracy.php @@ -9,10 +9,6 @@ use Phpml\Exception\InvalidArgumentException; class Accuracy { /** - * @param array $actualLabels - * @param array $predictedLabels - * @param bool $normalize - * * @return float|int * * @throws InvalidArgumentException diff --git a/src/Phpml/Metric/ClassificationReport.php b/src/Phpml/Metric/ClassificationReport.php index dac82a0..f4fdaee 100644 --- a/src/Phpml/Metric/ClassificationReport.php +++ b/src/Phpml/Metric/ClassificationReport.php @@ -130,12 +130,6 @@ class ClassificationReport return 2.0 * (($precision * $recall) / $divider); } - /** - * @param array $actualLabels - * @param array $predictedLabels - * - * @return array - */ private static function getLabelIndexedArray(array $actualLabels, array $predictedLabels) : array { $labels = array_values(array_unique(array_merge($actualLabels, $predictedLabels))); diff --git a/src/Phpml/Metric/ConfusionMatrix.php b/src/Phpml/Metric/ConfusionMatrix.php index 9dc2595..5c7bc0b 100644 --- a/src/Phpml/Metric/ConfusionMatrix.php +++ b/src/Phpml/Metric/ConfusionMatrix.php @@ -6,13 +6,6 @@ namespace Phpml\Metric; class ConfusionMatrix { - /** - * @param array $actualLabels - * @param array $predictedLabels - * @param array $labels - * - * @return array - */ public static function compute(array $actualLabels, array $predictedLabels, array $labels = null) : array { $labels = $labels ? array_flip($labels) : self::getUniqueLabels($actualLabels); @@ -38,11 +31,6 @@ class ConfusionMatrix return $matrix; } - /** - * @param array $labels - * - * @return array - */ private static function generateMatrixWithZeros(array $labels) : array { $count = count($labels); @@ -55,11 +43,6 @@ class ConfusionMatrix return $matrix; } - /** - * @param array $labels - * - * @return array - */ private static function getUniqueLabels(array $labels) : array { $labels = array_values(array_unique($labels)); diff --git a/src/Phpml/NeuralNetwork/Network/LayeredNetwork.php b/src/Phpml/NeuralNetwork/Network/LayeredNetwork.php index 3f8bc04..1234c41 100644 --- a/src/Phpml/NeuralNetwork/Network/LayeredNetwork.php +++ b/src/Phpml/NeuralNetwork/Network/LayeredNetwork.php @@ -39,9 +39,6 @@ abstract class LayeredNetwork implements Network return $this->layers[count($this->layers) - 1]; } - /** - * @return array - */ public function getOutput() : array { $result = []; diff --git a/src/Phpml/NeuralNetwork/Node/Neuron/Synapse.php b/src/Phpml/NeuralNetwork/Node/Neuron/Synapse.php index 35c8a0c..adb4b02 100644 --- a/src/Phpml/NeuralNetwork/Node/Neuron/Synapse.php +++ b/src/Phpml/NeuralNetwork/Node/Neuron/Synapse.php @@ -19,7 +19,6 @@ class Synapse protected $node; /** - * @param Node $node * @param float|null $weight */ public function __construct(Node $node, float $weight = null) diff --git a/src/Phpml/Pipeline.php b/src/Phpml/Pipeline.php index 5330daf..a49fb27 100644 --- a/src/Phpml/Pipeline.php +++ b/src/Phpml/Pipeline.php @@ -18,7 +18,6 @@ class Pipeline implements Estimator /** * @param array|Transformer[] $transformers - * @param Estimator $estimator */ public function __construct(array $transformers, Estimator $estimator) { @@ -52,10 +51,6 @@ class Pipeline implements Estimator return $this->estimator; } - /** - * @param array $samples - * @param array $targets - */ public function train(array $samples, array $targets) { foreach ($this->transformers as $transformer) { @@ -67,8 +62,6 @@ class Pipeline implements Estimator } /** - * @param array $samples - * * @return mixed */ public function predict(array $samples) @@ -78,9 +71,6 @@ class Pipeline implements Estimator return $this->estimator->predict($samples); } - /** - * @param array $samples - */ private function transformSamples(array &$samples) { foreach ($this->transformers as $transformer) { diff --git a/src/Phpml/Preprocessing/Imputer.php b/src/Phpml/Preprocessing/Imputer.php index ee9282b..cc90c46 100644 --- a/src/Phpml/Preprocessing/Imputer.php +++ b/src/Phpml/Preprocessing/Imputer.php @@ -33,8 +33,6 @@ class Imputer implements Preprocessor /** * @param mixed $missingValue - * @param Strategy $strategy - * @param int $axis * @param array|null $samples */ public function __construct($missingValue, Strategy $strategy, int $axis = self::AXIS_COLUMN, array $samples = []) @@ -45,17 +43,11 @@ class Imputer implements Preprocessor $this->samples = $samples; } - /** - * @param array $samples - */ public function fit(array $samples) { $this->samples = $samples; } - /** - * @param array $samples - */ public function transform(array &$samples) { foreach ($samples as &$sample) { @@ -63,9 +55,6 @@ class Imputer implements Preprocessor } } - /** - * @param array $sample - */ private function preprocessSample(array &$sample) { foreach ($sample as $column => &$value) { @@ -75,12 +64,6 @@ class Imputer implements Preprocessor } } - /** - * @param int $column - * @param array $currentSample - * - * @return array - */ private function getAxis(int $column, array $currentSample) : array { if (self::AXIS_ROW === $this->axis) { diff --git a/src/Phpml/Preprocessing/Imputer/Strategy/MeanStrategy.php b/src/Phpml/Preprocessing/Imputer/Strategy/MeanStrategy.php index 4c57d8d..91badfb 100644 --- a/src/Phpml/Preprocessing/Imputer/Strategy/MeanStrategy.php +++ b/src/Phpml/Preprocessing/Imputer/Strategy/MeanStrategy.php @@ -9,9 +9,6 @@ use Phpml\Preprocessing\Imputer\Strategy; class MeanStrategy implements Strategy { - /** - * @param array $currentAxis - */ public function replaceValue(array $currentAxis) : float { return Mean::arithmetic($currentAxis); diff --git a/src/Phpml/Preprocessing/Imputer/Strategy/MedianStrategy.php b/src/Phpml/Preprocessing/Imputer/Strategy/MedianStrategy.php index cf60f7e..f010bea 100644 --- a/src/Phpml/Preprocessing/Imputer/Strategy/MedianStrategy.php +++ b/src/Phpml/Preprocessing/Imputer/Strategy/MedianStrategy.php @@ -9,9 +9,6 @@ use Phpml\Preprocessing\Imputer\Strategy; class MedianStrategy implements Strategy { - /** - * @param array $currentAxis - */ public function replaceValue(array $currentAxis) : float { return Mean::median($currentAxis); diff --git a/src/Phpml/Preprocessing/Imputer/Strategy/MostFrequentStrategy.php b/src/Phpml/Preprocessing/Imputer/Strategy/MostFrequentStrategy.php index 9aea453..9a8fd63 100644 --- a/src/Phpml/Preprocessing/Imputer/Strategy/MostFrequentStrategy.php +++ b/src/Phpml/Preprocessing/Imputer/Strategy/MostFrequentStrategy.php @@ -10,8 +10,6 @@ use Phpml\Preprocessing\Imputer\Strategy; class MostFrequentStrategy implements Strategy { /** - * @param array $currentAxis - * * @return float|mixed */ public function replaceValue(array $currentAxis) diff --git a/src/Phpml/Preprocessing/Normalizer.php b/src/Phpml/Preprocessing/Normalizer.php index 412e06e..07777f9 100644 --- a/src/Phpml/Preprocessing/Normalizer.php +++ b/src/Phpml/Preprocessing/Normalizer.php @@ -46,9 +46,6 @@ class Normalizer implements Preprocessor $this->norm = $norm; } - /** - * @param array $samples - */ public function fit(array $samples) { if ($this->fitted) { @@ -67,9 +64,6 @@ class Normalizer implements Preprocessor $this->fitted = true; } - /** - * @param array $samples - */ public function transform(array &$samples) { $methods = [ @@ -86,9 +80,6 @@ class Normalizer implements Preprocessor } } - /** - * @param array $sample - */ private function normalizeL1(array &$sample) { $norm1 = 0; @@ -106,9 +97,6 @@ class Normalizer implements Preprocessor } } - /** - * @param array $sample - */ private function normalizeL2(array &$sample) { $norm2 = 0; @@ -126,9 +114,6 @@ class Normalizer implements Preprocessor } } - /** - * @param array $sample - */ private function normalizeSTD(array &$sample) { foreach ($sample as $i => $val) { diff --git a/tests/Phpml/Classification/MLPClassifierTest.php b/tests/Phpml/Classification/MLPClassifierTest.php index 95438c6..1745bc6 100644 --- a/tests/Phpml/Classification/MLPClassifierTest.php +++ b/tests/Phpml/Classification/MLPClassifierTest.php @@ -189,11 +189,6 @@ class MLPClassifierTest extends TestCase new MLPClassifier(2, [2], [0]); } - /** - * @param array $synapses - * - * @return array - */ private function getSynapsesNodes(array $synapses) : array { $nodes = []; diff --git a/tests/Phpml/CrossValidation/StratifiedRandomSplitTest.php b/tests/Phpml/CrossValidation/StratifiedRandomSplitTest.php index ef07398..57023d3 100644 --- a/tests/Phpml/CrossValidation/StratifiedRandomSplitTest.php +++ b/tests/Phpml/CrossValidation/StratifiedRandomSplitTest.php @@ -46,12 +46,6 @@ class StratifiedRandomSplitTest extends TestCase $this->assertEquals(1, $this->countSamplesByTarget($split->getTestLabels(), 2)); } - /** - * @param $splitTargets - * @param $countTarget - * - * @return int - */ private function countSamplesByTarget($splitTargets, $countTarget): int { $count = 0; diff --git a/tests/Phpml/Math/ComparisonTest.php b/tests/Phpml/Math/ComparisonTest.php index 2d41273..8fff3cb 100644 --- a/tests/Phpml/Math/ComparisonTest.php +++ b/tests/Phpml/Math/ComparisonTest.php @@ -12,8 +12,6 @@ class ComparisonTest extends TestCase /** * @param mixed $a * @param mixed $b - * @param string $operator - * @param bool $expected * * @dataProvider provideData */ diff --git a/tests/Phpml/Math/MatrixTest.php b/tests/Phpml/Math/MatrixTest.php index 257fd72..0285b61 100644 --- a/tests/Phpml/Math/MatrixTest.php +++ b/tests/Phpml/Math/MatrixTest.php @@ -261,7 +261,6 @@ class MatrixTest extends TestCase $matrix1 = [[1, 1], [2, 2]]; $matrix2 = [[3, 3], [3, 3], [3, 3]]; $dot = [6, 12]; - $this->assertEquals($dot, Matrix::dot($matrix2, $matrix1)); } } diff --git a/tests/Phpml/NeuralNetwork/ActivationFunction/BinaryStepTest.php b/tests/Phpml/NeuralNetwork/ActivationFunction/BinaryStepTest.php index 85cf9f8..a62b1c9 100644 --- a/tests/Phpml/NeuralNetwork/ActivationFunction/BinaryStepTest.php +++ b/tests/Phpml/NeuralNetwork/ActivationFunction/BinaryStepTest.php @@ -10,9 +10,6 @@ use PHPUnit\Framework\TestCase; class BinaryStepTest extends TestCase { /** - * @param $expected - * @param $value - * * @dataProvider binaryStepProvider */ public function testBinaryStepActivationFunction($expected, $value) diff --git a/tests/Phpml/NeuralNetwork/ActivationFunction/GaussianTest.php b/tests/Phpml/NeuralNetwork/ActivationFunction/GaussianTest.php index 7835573..19b6cca 100644 --- a/tests/Phpml/NeuralNetwork/ActivationFunction/GaussianTest.php +++ b/tests/Phpml/NeuralNetwork/ActivationFunction/GaussianTest.php @@ -10,9 +10,6 @@ use PHPUnit\Framework\TestCase; class GaussianTest extends TestCase { /** - * @param $expected - * @param $value - * * @dataProvider gaussianProvider */ public function testGaussianActivationFunction($expected, $value) diff --git a/tests/Phpml/NeuralNetwork/ActivationFunction/HyperboliTangentTest.php b/tests/Phpml/NeuralNetwork/ActivationFunction/HyperboliTangentTest.php index b490832..b27dfa0 100644 --- a/tests/Phpml/NeuralNetwork/ActivationFunction/HyperboliTangentTest.php +++ b/tests/Phpml/NeuralNetwork/ActivationFunction/HyperboliTangentTest.php @@ -10,10 +10,6 @@ use PHPUnit\Framework\TestCase; class HyperboliTangentTest extends TestCase { /** - * @param $beta - * @param $expected - * @param $value - * * @dataProvider tanhProvider */ public function testHyperbolicTangentActivationFunction($beta, $expected, $value) diff --git a/tests/Phpml/NeuralNetwork/ActivationFunction/PReLUTest.php b/tests/Phpml/NeuralNetwork/ActivationFunction/PReLUTest.php index a390bf0..5e14ce8 100644 --- a/tests/Phpml/NeuralNetwork/ActivationFunction/PReLUTest.php +++ b/tests/Phpml/NeuralNetwork/ActivationFunction/PReLUTest.php @@ -10,10 +10,6 @@ use PHPUnit\Framework\TestCase; class PReLUTest extends TestCase { /** - * @param $beta - * @param $expected - * @param $value - * * @dataProvider preluProvider */ public function testPReLUActivationFunction($beta, $expected, $value) diff --git a/tests/Phpml/NeuralNetwork/ActivationFunction/SigmoidTest.php b/tests/Phpml/NeuralNetwork/ActivationFunction/SigmoidTest.php index add1b34..6894006 100644 --- a/tests/Phpml/NeuralNetwork/ActivationFunction/SigmoidTest.php +++ b/tests/Phpml/NeuralNetwork/ActivationFunction/SigmoidTest.php @@ -10,10 +10,6 @@ use PHPUnit\Framework\TestCase; class SigmoidTest extends TestCase { /** - * @param $beta - * @param $expected - * @param $value - * * @dataProvider sigmoidProvider */ public function testSigmoidActivationFunction($beta, $expected, $value) diff --git a/tests/Phpml/NeuralNetwork/ActivationFunction/ThresholdedReLUTest.php b/tests/Phpml/NeuralNetwork/ActivationFunction/ThresholdedReLUTest.php index b0c6ecf..571a197 100644 --- a/tests/Phpml/NeuralNetwork/ActivationFunction/ThresholdedReLUTest.php +++ b/tests/Phpml/NeuralNetwork/ActivationFunction/ThresholdedReLUTest.php @@ -10,10 +10,6 @@ use PHPUnit\Framework\TestCase; class ThresholdedReLUTest extends TestCase { /** - * @param $theta - * @param $expected - * @param $value - * * @dataProvider thresholdProvider */ public function testThresholdedReLUActivationFunction($theta, $expected, $value)