From bf5d32cb6e6d926b38ad3313781deaf411c18efa Mon Sep 17 00:00:00 2001 From: Andrew DalPino Date: Sat, 16 Mar 2024 20:00:12 -0500 Subject: [PATCH] Fix coding style and composer.lock --- composer.json | 2 +- src/AnomalyDetectors/LocalOutlierFactor.php | 2 +- src/AnomalyDetectors/Loda.php | 2 +- src/AnomalyDetectors/OneClassSVM.php | 4 ++-- src/Classifiers/AdaBoost.php | 2 +- src/Classifiers/KDNeighbors.php | 2 +- src/Classifiers/KNearestNeighbors.php | 2 +- src/Classifiers/LogisticRegression.php | 8 ++++---- src/Classifiers/LogitBoost.php | 4 ++-- src/Classifiers/MultilayerPerceptron.php | 10 +++++----- src/Classifiers/RadiusNeighbors.php | 2 +- src/Classifiers/RandomForest.php | 2 +- src/Classifiers/SVC.php | 4 ++-- src/Classifiers/SoftmaxClassifier.php | 8 ++++---- src/Clusterers/DBSCAN.php | 2 +- src/Clusterers/FuzzyCMeans.php | 4 ++-- src/Clusterers/GaussianMixture.php | 2 +- src/Clusterers/KMeans.php | 4 ++-- src/Clusterers/MeanShift.php | 6 +++--- src/Clusterers/Seeders/KMC2.php | 2 +- src/Clusterers/Seeders/PlusPlus.php | 2 +- src/Datasets/Generators/Blob.php | 2 +- src/Graph/Nodes/Traits/HasBinaryChildrenTrait.php | 12 ++++++------ src/Graph/Trees/BallTree.php | 4 ++-- src/Graph/Trees/DecisionTree.php | 4 ++-- src/Graph/Trees/ITree.php | 4 ++-- src/Graph/Trees/KDTree.php | 4 ++-- src/Graph/Trees/VantageTree.php | 4 ++-- src/GridSearch.php | 4 ++-- src/NeuralNet/Layers/Activation.php | 4 ++-- src/NeuralNet/Layers/BatchNorm.php | 10 +++++----- src/NeuralNet/Layers/Binary.php | 6 +++--- src/NeuralNet/Layers/Continuous.php | 4 ++-- src/NeuralNet/Layers/Dense.php | 10 +++++----- src/NeuralNet/Layers/Dropout.php | 2 +- src/NeuralNet/Layers/Multiclass.php | 6 +++--- src/NeuralNet/Layers/PReLU.php | 6 +++--- src/NeuralNet/Layers/Swish.php | 8 ++++---- src/PersistentModel.php | 4 ++-- src/Regressors/Adaline.php | 8 ++++---- src/Regressors/GradientBoost.php | 4 ++-- src/Regressors/KDNeighborsRegressor.php | 2 +- src/Regressors/KNNRegressor.php | 2 +- src/Regressors/MLPRegressor.php | 10 +++++----- src/Regressors/RadiusNeighborsRegressor.php | 2 +- src/Regressors/Ridge.php | 2 +- src/Regressors/SVR.php | 4 ++-- src/Traits/LoggerAware.php | 6 +++--- src/Transformers/GaussianRandomProjector.php | 2 +- src/Transformers/HotDeckImputer.php | 2 +- src/Transformers/KNNImputer.php | 2 +- src/Transformers/LinearDiscriminantAnalysis.php | 2 +- src/Transformers/MissingDataImputer.php | 4 ++-- src/Transformers/PrincipalComponentAnalysis.php | 2 +- src/Transformers/TSNE.php | 2 +- src/Transformers/TokenHashingVectorizer.php | 2 +- src/Transformers/TruncatedSVD.php | 2 +- src/Transformers/WordCountVectorizer.php | 2 +- src/Verbose.php | 2 +- 59 files changed, 119 insertions(+), 119 deletions(-) diff --git a/composer.json b/composer.json index 0f34eedb4..2b1439154 100644 --- a/composer.json +++ b/composer.json @@ -80,7 +80,7 @@ "@test", "@check" ], - "analyze": "phpstan analyse -c phpstan.neon", + "analyze": "phpstan analyse -c phpstan.neon --memory-limit 1G", "benchmark": "phpbench run --report=aggregate", "check": [ "@putenv PHP_CS_FIXER_IGNORE_ENV=1", diff --git a/src/AnomalyDetectors/LocalOutlierFactor.php b/src/AnomalyDetectors/LocalOutlierFactor.php index 5c798b4b6..91e42869f 100644 --- a/src/AnomalyDetectors/LocalOutlierFactor.php +++ b/src/AnomalyDetectors/LocalOutlierFactor.php @@ -104,7 +104,7 @@ class LocalOutlierFactor implements Estimator, Learner, Scoring, Persistable /** * @param int $k * @param float|null $contamination - * @param \Rubix\ML\Graph\Trees\Spatial|null $tree + * @param Spatial|null $tree * @throws InvalidArgumentException */ public function __construct(int $k = 20, ?float $contamination = null, ?Spatial $tree = null) diff --git a/src/AnomalyDetectors/Loda.php b/src/AnomalyDetectors/Loda.php index cf76762e3..9cb149820 100644 --- a/src/AnomalyDetectors/Loda.php +++ b/src/AnomalyDetectors/Loda.php @@ -98,7 +98,7 @@ class Loda implements Estimator, Learner, Online, Scoring, Persistable /** * The sparse random projection matrix. * - * @var \Tensor\Matrix|null + * @var Matrix|null */ protected ?Matrix $r = null; diff --git a/src/AnomalyDetectors/OneClassSVM.php b/src/AnomalyDetectors/OneClassSVM.php index 10969ab6f..a7ee88df2 100644 --- a/src/AnomalyDetectors/OneClassSVM.php +++ b/src/AnomalyDetectors/OneClassSVM.php @@ -56,13 +56,13 @@ class OneClassSVM implements Estimator, Learner /** * The trained model instance. * - * @var \svmmodel|null + * @var svmmodel|null */ protected ?svmmodel $model = null; /** * @param float $nu - * @param \Rubix\ML\Kernels\SVM\Kernel|null $kernel + * @param Kernel|null $kernel * @param bool $shrinking * @param float $tolerance * @param float $cacheSize diff --git a/src/Classifiers/AdaBoost.php b/src/Classifiers/AdaBoost.php index 9c74fbd7a..f3237967d 100644 --- a/src/Classifiers/AdaBoost.php +++ b/src/Classifiers/AdaBoost.php @@ -145,7 +145,7 @@ class AdaBoost implements Estimator, Learner, Probabilistic, Verbose, Persistabl protected ?int $featureCount = null; /** - * @param \Rubix\ML\Learner|null $base + * @param Learner|null $base * @param float $rate * @param float $ratio * @param int $epochs diff --git a/src/Classifiers/KDNeighbors.php b/src/Classifiers/KDNeighbors.php index 4ef9f5864..8d13fee6f 100644 --- a/src/Classifiers/KDNeighbors.php +++ b/src/Classifiers/KDNeighbors.php @@ -81,7 +81,7 @@ class KDNeighbors implements Estimator, Learner, Probabilistic, Persistable /** * @param int $k * @param bool $weighted - * @param \Rubix\ML\Graph\Trees\Spatial|null $tree + * @param Spatial|null $tree * @throws InvalidArgumentException */ public function __construct(int $k = 5, bool $weighted = false, ?Spatial $tree = null) diff --git a/src/Classifiers/KNearestNeighbors.php b/src/Classifiers/KNearestNeighbors.php index ee5c4b39b..94862ddd8 100644 --- a/src/Classifiers/KNearestNeighbors.php +++ b/src/Classifiers/KNearestNeighbors.php @@ -94,7 +94,7 @@ class KNearestNeighbors implements Estimator, Learner, Online, Probabilistic, Pe /** * @param int $k * @param bool $weighted - * @param \Rubix\ML\Kernels\Distance\Distance|null $kernel + * @param Distance|null $kernel * @throws InvalidArgumentException */ public function __construct(int $k = 5, bool $weighted = false, ?Distance $kernel = null) diff --git a/src/Classifiers/LogisticRegression.php b/src/Classifiers/LogisticRegression.php index 81eef3ac3..c4e23c1bf 100644 --- a/src/Classifiers/LogisticRegression.php +++ b/src/Classifiers/LogisticRegression.php @@ -108,7 +108,7 @@ class LogisticRegression implements Estimator, Learner, Online, Probabilistic, R /** * The underlying neural network instance. * - * @var \Rubix\ML\NeuralNet\FeedForward|null + * @var FeedForward|null */ protected ?FeedForward $network = null; @@ -128,12 +128,12 @@ class LogisticRegression implements Estimator, Learner, Online, Probabilistic, R /** * @param int $batchSize - * @param \Rubix\ML\NeuralNet\Optimizers\Optimizer|null $optimizer + * @param Optimizer|null $optimizer * @param float $l2Penalty * @param int $epochs * @param float $minChange * @param int $window - * @param \Rubix\ML\NeuralNet\CostFunctions\ClassificationLoss|null $costFn + * @param ClassificationLoss|null $costFn * @throws InvalidArgumentException */ public function __construct( @@ -267,7 +267,7 @@ public function losses() : ?array /** * Return the underlying neural network instance or null if not trained. * - * @return \Rubix\ML\NeuralNet\FeedForward|null + * @return FeedForward|null */ public function network() : ?FeedForward { diff --git a/src/Classifiers/LogitBoost.php b/src/Classifiers/LogitBoost.php index f12588cfb..8a39be711 100644 --- a/src/Classifiers/LogitBoost.php +++ b/src/Classifiers/LogitBoost.php @@ -176,14 +176,14 @@ class LogitBoost implements Estimator, Learner, Probabilistic, RanksFeatures, Ve protected ?int $featureCount = null; /** - * @param \Rubix\ML\Learner|null $booster + * @param Learner|null $booster * @param float $rate * @param float $ratio * @param int $epochs * @param float $minChange * @param int $window * @param float $holdOut - * @param \Rubix\ML\CrossValidation\Metrics\Metric|null $metric + * @param Metric|null $metric * @throws InvalidArgumentException */ public function __construct( diff --git a/src/Classifiers/MultilayerPerceptron.php b/src/Classifiers/MultilayerPerceptron.php index 233c8b1eb..a943ebef9 100644 --- a/src/Classifiers/MultilayerPerceptron.php +++ b/src/Classifiers/MultilayerPerceptron.php @@ -139,7 +139,7 @@ class MultilayerPerceptron implements Estimator, Learner, Online, Probabilistic, /** * The underlying neural network instance. * - * @var \Rubix\ML\NeuralNet\FeedForward|null + * @var FeedForward|null */ protected ?FeedForward $network = null; @@ -167,14 +167,14 @@ class MultilayerPerceptron implements Estimator, Learner, Online, Probabilistic, /** * @param \Rubix\ML\NeuralNet\Layers\Hidden[] $hiddenLayers * @param int $batchSize - * @param \Rubix\ML\NeuralNet\Optimizers\Optimizer|null $optimizer + * @param Optimizer|null $optimizer * @param float $l2Penalty * @param int $epochs * @param float $minChange * @param int $window * @param float $holdOut - * @param \Rubix\ML\NeuralNet\CostFunctions\ClassificationLoss|null $costFn - * @param \Rubix\ML\CrossValidation\Metrics\Metric|null $metric + * @param ClassificationLoss|null $costFn + * @param Metric|null $metric * @throws InvalidArgumentException */ public function __construct( @@ -344,7 +344,7 @@ public function losses() : ?array /** * Return the underlying neural network instance or null if not trained. * - * @return \Rubix\ML\NeuralNet\FeedForward|null + * @return FeedForward|null */ public function network() : ?FeedForward { diff --git a/src/Classifiers/RadiusNeighbors.php b/src/Classifiers/RadiusNeighbors.php index 1dc670186..e5309d7c4 100644 --- a/src/Classifiers/RadiusNeighbors.php +++ b/src/Classifiers/RadiusNeighbors.php @@ -89,7 +89,7 @@ class RadiusNeighbors implements Estimator, Learner, Probabilistic, Persistable * @param float $radius * @param bool $weighted * @param string $outlierClass - * @param \Rubix\ML\Graph\Trees\Spatial|null $tree + * @param Spatial|null $tree * @throws InvalidArgumentException */ public function __construct( diff --git a/src/Classifiers/RandomForest.php b/src/Classifiers/RandomForest.php index eb62f5e32..34cf18865 100644 --- a/src/Classifiers/RandomForest.php +++ b/src/Classifiers/RandomForest.php @@ -118,7 +118,7 @@ class RandomForest implements Estimator, Learner, Probabilistic, Parallel, Ranks protected ?int $featureCount = null; /** - * @param \Rubix\ML\Learner|null $base + * @param Learner|null $base * @param int $estimators * @param float $ratio * @param bool $balanced diff --git a/src/Classifiers/SVC.php b/src/Classifiers/SVC.php index 93442f5fc..f8d1bece1 100644 --- a/src/Classifiers/SVC.php +++ b/src/Classifiers/SVC.php @@ -58,7 +58,7 @@ class SVC implements Estimator, Learner /** * The trained model instance. * - * @var \svmmodel|null + * @var svmmodel|null */ protected $model; @@ -73,7 +73,7 @@ class SVC implements Estimator, Learner /** * @param float $c - * @param \Rubix\ML\Kernels\SVM\Kernel|null $kernel + * @param Kernel|null $kernel * @param bool $shrinking * @param float $tolerance * @param float $cacheSize diff --git a/src/Classifiers/SoftmaxClassifier.php b/src/Classifiers/SoftmaxClassifier.php index 3038c04a3..e10054119 100644 --- a/src/Classifiers/SoftmaxClassifier.php +++ b/src/Classifiers/SoftmaxClassifier.php @@ -104,7 +104,7 @@ class SoftmaxClassifier implements Estimator, Learner, Online, Probabilistic, Ve /** * The underlying neural network instance. * - * @var \Rubix\ML\NeuralNet\FeedForward|null + * @var FeedForward|null */ protected ?FeedForward $network = null; @@ -124,12 +124,12 @@ class SoftmaxClassifier implements Estimator, Learner, Online, Probabilistic, Ve /** * @param int $batchSize - * @param \Rubix\ML\NeuralNet\Optimizers\Optimizer|null $optimizer + * @param Optimizer|null $optimizer * @param float $l2Penalty * @param int $epochs * @param float $minChange * @param int $window - * @param \Rubix\ML\NeuralNet\CostFunctions\ClassificationLoss|null $costFn + * @param ClassificationLoss|null $costFn * @throws InvalidArgumentException */ public function __construct( @@ -263,7 +263,7 @@ public function losses() : ?array /** * Return the underlying neural network instance or null if not trained. * - * @return \Rubix\ML\NeuralNet\FeedForward|null + * @return FeedForward|null */ public function network() : ?FeedForward { diff --git a/src/Clusterers/DBSCAN.php b/src/Clusterers/DBSCAN.php index c24546d37..c95249457 100644 --- a/src/Clusterers/DBSCAN.php +++ b/src/Clusterers/DBSCAN.php @@ -78,7 +78,7 @@ class DBSCAN implements Estimator /** * @param float $radius * @param int $minDensity - * @param \Rubix\ML\Graph\Trees\Spatial|null $tree + * @param Spatial|null $tree * @throws InvalidArgumentException */ public function __construct(float $radius = 0.5, int $minDensity = 5, ?Spatial $tree = null) diff --git a/src/Clusterers/FuzzyCMeans.php b/src/Clusterers/FuzzyCMeans.php index dd3b27b84..106a17725 100644 --- a/src/Clusterers/FuzzyCMeans.php +++ b/src/Clusterers/FuzzyCMeans.php @@ -122,8 +122,8 @@ class FuzzyCMeans implements Estimator, Learner, Probabilistic, Verbose, Persist * @param float $fuzz * @param int $epochs * @param float $minChange - * @param \Rubix\ML\Kernels\Distance\Distance|null $kernel - * @param Seeders\Seeder|null $seeder + * @param Distance|null $kernel + * @param Seeder|null $seeder * @throws InvalidArgumentException */ public function __construct( diff --git a/src/Clusterers/GaussianMixture.php b/src/Clusterers/GaussianMixture.php index 68338cfd9..fbc5d5db1 100644 --- a/src/Clusterers/GaussianMixture.php +++ b/src/Clusterers/GaussianMixture.php @@ -138,7 +138,7 @@ class GaussianMixture implements Estimator, Learner, Probabilistic, Verbose, Per * @param float $smoothing * @param int $epochs * @param float $minChange - * @param Seeders\Seeder|null $seeder + * @param Seeder|null $seeder * @throws InvalidArgumentException */ public function __construct( diff --git a/src/Clusterers/KMeans.php b/src/Clusterers/KMeans.php index 280e70922..420844d63 100644 --- a/src/Clusterers/KMeans.php +++ b/src/Clusterers/KMeans.php @@ -136,8 +136,8 @@ class KMeans implements Estimator, Learner, Online, Probabilistic, Verbose, Pers * @param int $epochs * @param float $minChange * @param int $window - * @param \Rubix\ML\Kernels\Distance\Distance|null $kernel - * @param Seeders\Seeder|null $seeder + * @param Distance|null $kernel + * @param Seeder|null $seeder * @throws InvalidArgumentException */ public function __construct( diff --git a/src/Clusterers/MeanShift.php b/src/Clusterers/MeanShift.php index 97af51353..e8ac31e53 100644 --- a/src/Clusterers/MeanShift.php +++ b/src/Clusterers/MeanShift.php @@ -139,7 +139,7 @@ class MeanShift implements Estimator, Learner, Probabilistic, Verbose, Persistab * * @param Dataset $dataset * @param float $percentile - * @param \Rubix\ML\Kernels\Distance\Distance|null $kernel + * @param Distance|null $kernel * @throws InvalidArgumentException * @return float */ @@ -175,8 +175,8 @@ public static function estimateRadius( * @param float $ratio * @param int $epochs * @param float $minShift - * @param \Rubix\ML\Graph\Trees\Spatial|null $tree - * @param Seeders\Seeder|null $seeder + * @param Spatial|null $tree + * @param Seeder|null $seeder * @throws InvalidArgumentException */ public function __construct( diff --git a/src/Clusterers/Seeders/KMC2.php b/src/Clusterers/Seeders/KMC2.php index 717a29426..c18beade7 100644 --- a/src/Clusterers/Seeders/KMC2.php +++ b/src/Clusterers/Seeders/KMC2.php @@ -43,7 +43,7 @@ class KMC2 implements Seeder /** * @param int $m - * @param \Rubix\ML\Kernels\Distance\Distance|null $kernel + * @param Distance|null $kernel * @throws InvalidArgumentException */ public function __construct(int $m = 50, ?Distance $kernel = null) diff --git a/src/Clusterers/Seeders/PlusPlus.php b/src/Clusterers/Seeders/PlusPlus.php index aeb2eb812..ddadd1877 100644 --- a/src/Clusterers/Seeders/PlusPlus.php +++ b/src/Clusterers/Seeders/PlusPlus.php @@ -36,7 +36,7 @@ class PlusPlus implements Seeder protected Distance $kernel; /** - * @param \Rubix\ML\Kernels\Distance\Distance|null $kernel + * @param Distance|null $kernel */ public function __construct(?Distance $kernel = null) { diff --git a/src/Datasets/Generators/Blob.php b/src/Datasets/Generators/Blob.php index 62f703ae6..f79778173 100644 --- a/src/Datasets/Generators/Blob.php +++ b/src/Datasets/Generators/Blob.php @@ -37,7 +37,7 @@ class Blob implements Generator /** * The standard deviation of the blob. * - * @var \Tensor\Vector|int|float + * @var Vector|int|float */ protected $stdDev; diff --git a/src/Graph/Nodes/Traits/HasBinaryChildrenTrait.php b/src/Graph/Nodes/Traits/HasBinaryChildrenTrait.php index 76aa8f484..504441672 100644 --- a/src/Graph/Nodes/Traits/HasBinaryChildrenTrait.php +++ b/src/Graph/Nodes/Traits/HasBinaryChildrenTrait.php @@ -21,14 +21,14 @@ trait HasBinaryChildrenTrait /** * The left child node. * - * @var \Rubix\ML\Graph\Nodes\BinaryNode|null + * @var BinaryNode|null */ protected ?BinaryNode $left = null; /** * The right child node. * - * @var \Rubix\ML\Graph\Nodes\BinaryNode|null + * @var BinaryNode|null */ protected ?BinaryNode $right = null; @@ -51,7 +51,7 @@ public function children() : Traversable /** * Return the left child node. * - * @return \Rubix\ML\Graph\Nodes\BinaryNode|null + * @return BinaryNode|null */ public function left() : ?BinaryNode { @@ -61,7 +61,7 @@ public function left() : ?BinaryNode /** * Return the right child node. * - * @return \Rubix\ML\Graph\Nodes\BinaryNode|null + * @return BinaryNode|null */ public function right() : ?BinaryNode { @@ -95,7 +95,7 @@ public function balance() : int /** * Set the left child node. * - * @param \Rubix\ML\Graph\Nodes\BinaryNode|null $node + * @param BinaryNode|null $node */ public function attachLeft(?BinaryNode $node = null) : void { @@ -105,7 +105,7 @@ public function attachLeft(?BinaryNode $node = null) : void /** * Set the right child node. * - * @param \Rubix\ML\Graph\Nodes\BinaryNode|null $node + * @param BinaryNode|null $node */ public function attachRight(?BinaryNode $node = null) : void { diff --git a/src/Graph/Trees/BallTree.php b/src/Graph/Trees/BallTree.php index 8194e779a..649ad0b55 100644 --- a/src/Graph/Trees/BallTree.php +++ b/src/Graph/Trees/BallTree.php @@ -52,13 +52,13 @@ class BallTree implements BinaryTree, Spatial /** * The root node of the tree. * - * @var \Rubix\ML\Graph\Nodes\Ball|null + * @var Ball|null */ protected ?Ball $root = null; /** * @param int $maxLeafSize - * @param \Rubix\ML\Kernels\Distance\Distance|null $kernel + * @param Distance|null $kernel * @throws InvalidArgumentException */ public function __construct(int $maxLeafSize = 30, ?Distance $kernel = null) diff --git a/src/Graph/Trees/DecisionTree.php b/src/Graph/Trees/DecisionTree.php index 63be69730..764cb42a2 100644 --- a/src/Graph/Trees/DecisionTree.php +++ b/src/Graph/Trees/DecisionTree.php @@ -65,7 +65,7 @@ abstract class DecisionTree implements BinaryTree, IteratorAggregate /** * The root node of the tree. * - * @var \Rubix\ML\Graph\Nodes\Split|null + * @var Split|null */ protected ?Split $root = null; @@ -242,7 +242,7 @@ public function grow(Labeled $dataset) : void * @internal * * @param list $sample - * @return \Rubix\ML\Graph\Nodes\Outcome|null + * @return Outcome|null */ public function search(array $sample) : ?Outcome { diff --git a/src/Graph/Trees/ITree.php b/src/Graph/Trees/ITree.php index 23df4e8d7..37a88bdf8 100644 --- a/src/Graph/Trees/ITree.php +++ b/src/Graph/Trees/ITree.php @@ -41,7 +41,7 @@ class ITree implements BinaryTree /** * The root node of the tree. * - * @var \Rubix\ML\Graph\Nodes\Isolator|null + * @var Isolator|null */ protected ?Isolator $root = null; @@ -155,7 +155,7 @@ public function grow(Dataset $dataset) : void * Search the tree for a leaf node. * * @param list $sample - * @return \Rubix\ML\Graph\Nodes\Depth|null + * @return Depth|null */ public function search(array $sample) : ?Depth { diff --git a/src/Graph/Trees/KDTree.php b/src/Graph/Trees/KDTree.php index 737b075be..e9426d92a 100644 --- a/src/Graph/Trees/KDTree.php +++ b/src/Graph/Trees/KDTree.php @@ -51,13 +51,13 @@ class KDTree implements BinaryTree, Spatial /** * The root node of the tree. * - * @var \Rubix\ML\Graph\Nodes\Box|null + * @var Box|null */ protected ?Box $root = null; /** * @param int $maxLeafSize - * @param \Rubix\ML\Kernels\Distance\Distance|null $kernel + * @param Distance|null $kernel * @throws InvalidArgumentException */ public function __construct(int $maxLeafSize = 30, ?Distance $kernel = null) diff --git a/src/Graph/Trees/VantageTree.php b/src/Graph/Trees/VantageTree.php index 8cc3c5fd9..a1c0d648b 100644 --- a/src/Graph/Trees/VantageTree.php +++ b/src/Graph/Trees/VantageTree.php @@ -51,13 +51,13 @@ class VantageTree implements BinaryTree, Spatial /** * The root node of the tree. * - * @var \Rubix\ML\Graph\Nodes\VantagePoint|null + * @var VantagePoint|null */ protected $root; /** * @param int $maxLeafSize - * @param \Rubix\ML\Kernels\Distance\Distance|null $kernel + * @param Distance|null $kernel * @throws \InvalidArgumentException */ public function __construct(int $maxLeafSize = 30, ?Distance $kernel = null) diff --git a/src/GridSearch.php b/src/GridSearch.php index 7dbe24f16..67140769b 100644 --- a/src/GridSearch.php +++ b/src/GridSearch.php @@ -115,8 +115,8 @@ protected static function combine(array $params) : array /** * @param class-string $class * @param array $params - * @param CrossValidation\Metrics\Metric|null $metric - * @param CrossValidation\Validator|null $validator + * @param Metric|null $metric + * @param Validator|null $validator * @throws InvalidArgumentException */ public function __construct( diff --git a/src/NeuralNet/Layers/Activation.php b/src/NeuralNet/Layers/Activation.php index 29b5f37c2..27df86cd1 100644 --- a/src/NeuralNet/Layers/Activation.php +++ b/src/NeuralNet/Layers/Activation.php @@ -37,14 +37,14 @@ class Activation implements Hidden /** * The memorized input matrix. * - * @var \Tensor\Matrix|null + * @var Matrix|null */ protected ?Matrix $input = null; /** * The memorized activation matrix. * - * @var \Tensor\Matrix|null + * @var Matrix|null */ protected ?Matrix $output = null; diff --git a/src/NeuralNet/Layers/BatchNorm.php b/src/NeuralNet/Layers/BatchNorm.php index d1a8e8631..2fdddb8f1 100644 --- a/src/NeuralNet/Layers/BatchNorm.php +++ b/src/NeuralNet/Layers/BatchNorm.php @@ -64,14 +64,14 @@ class BatchNorm implements Hidden, Parametric /** * The learnable centering parameter. * - * @var \Rubix\ML\NeuralNet\Parameter|null + * @var Parameter|null */ protected ?Parameter $beta = null; /** * The learnable scaling parameter. * - * @var \Rubix\ML\NeuralNet\Parameter|null + * @var Parameter|null */ protected ?Parameter $gamma = null; @@ -99,14 +99,14 @@ class BatchNorm implements Hidden, Parametric /** * A cache of normalized inputs to the layer. * - * @var \Tensor\Matrix|null + * @var Matrix|null */ protected ?Matrix $xHat = null; /** * @param float $decay - * @param \Rubix\ML\NeuralNet\Initializers\Initializer|null $betaInitializer - * @param \Rubix\ML\NeuralNet\Initializers\Initializer|null $gammaInitializer + * @param Initializer|null $betaInitializer + * @param Initializer|null $gammaInitializer * @throws InvalidArgumentException */ public function __construct( diff --git a/src/NeuralNet/Layers/Binary.php b/src/NeuralNet/Layers/Binary.php index 109231823..0d3316b92 100644 --- a/src/NeuralNet/Layers/Binary.php +++ b/src/NeuralNet/Layers/Binary.php @@ -53,20 +53,20 @@ class Binary implements Output /** * The memorized input matrix. * - * @var \Tensor\Matrix|null + * @var Matrix|null */ protected ?Matrix $input = null; /** * The memorized activation matrix. * - * @var \Tensor\Matrix|null + * @var Matrix|null */ protected ?Matrix $output = null; /** * @param string[] $classes - * @param \Rubix\ML\NeuralNet\CostFunctions\ClassificationLoss|null $costFn + * @param ClassificationLoss|null $costFn * @throws InvalidArgumentException */ public function __construct(array $classes, ?ClassificationLoss $costFn = null) diff --git a/src/NeuralNet/Layers/Continuous.php b/src/NeuralNet/Layers/Continuous.php index 938c0900a..8a67fb2b3 100644 --- a/src/NeuralNet/Layers/Continuous.php +++ b/src/NeuralNet/Layers/Continuous.php @@ -33,12 +33,12 @@ class Continuous implements Output /** * The memorized input matrix. * - * @var \Tensor\Matrix|null + * @var Matrix|null */ protected ?Matrix $input = null; /** - * @param \Rubix\ML\NeuralNet\CostFunctions\RegressionLoss|null $costFn + * @param RegressionLoss|null $costFn */ public function __construct(?RegressionLoss $costFn = null) { diff --git a/src/NeuralNet/Layers/Dense.php b/src/NeuralNet/Layers/Dense.php index 4bcfcb0bb..9b84629ed 100644 --- a/src/NeuralNet/Layers/Dense.php +++ b/src/NeuralNet/Layers/Dense.php @@ -66,21 +66,21 @@ class Dense implements Hidden, Parametric /** * The weights. * - * @var \Rubix\ML\NeuralNet\Parameter|null + * @var Parameter|null */ protected ?Parameter $weights = null; /** * The biases. * - * @var \Rubix\ML\NeuralNet\Parameter|null + * @var Parameter|null */ protected ?Parameter $biases = null; /** * The memorized inputs to the layer. * - * @var \Tensor\Matrix|null + * @var Matrix|null */ protected ?Matrix $input = null; @@ -88,8 +88,8 @@ class Dense implements Hidden, Parametric * @param int $neurons * @param float $l2Penalty * @param bool $bias - * @param \Rubix\ML\NeuralNet\Initializers\Initializer|null $weightInitializer - * @param \Rubix\ML\NeuralNet\Initializers\Initializer|null $biasInitializer + * @param Initializer|null $weightInitializer + * @param Initializer|null $biasInitializer * @throws InvalidArgumentException */ public function __construct( diff --git a/src/NeuralNet/Layers/Dropout.php b/src/NeuralNet/Layers/Dropout.php index 3f888dbda..36d7a67b1 100644 --- a/src/NeuralNet/Layers/Dropout.php +++ b/src/NeuralNet/Layers/Dropout.php @@ -50,7 +50,7 @@ class Dropout implements Hidden /** * The memoized dropout mask. * - * @var \Tensor\Matrix|null + * @var Matrix|null */ protected ?Matrix $mask = null; diff --git a/src/NeuralNet/Layers/Multiclass.php b/src/NeuralNet/Layers/Multiclass.php index f5073d2e9..da9119774 100644 --- a/src/NeuralNet/Layers/Multiclass.php +++ b/src/NeuralNet/Layers/Multiclass.php @@ -53,20 +53,20 @@ class Multiclass implements Output /** * The memorized input matrix. * - * @var \Tensor\Matrix|null + * @var Matrix|null */ protected ?Matrix $input = null; /** * The memorized activation matrix. * - * @var \Tensor\Matrix|null + * @var Matrix|null */ protected ?Matrix $output = null; /** * @param string[] $classes - * @param \Rubix\ML\NeuralNet\CostFunctions\ClassificationLoss|null $costFn + * @param ClassificationLoss|null $costFn * @throws InvalidArgumentException */ public function __construct(array $classes, ?ClassificationLoss $costFn = null) diff --git a/src/NeuralNet/Layers/PReLU.php b/src/NeuralNet/Layers/PReLU.php index c90eda9d9..874d6fadf 100644 --- a/src/NeuralNet/Layers/PReLU.php +++ b/src/NeuralNet/Layers/PReLU.php @@ -44,19 +44,19 @@ class PReLU implements Hidden, Parametric /** * The parameterized leakage coefficients. * - * @var \Rubix\ML\NeuralNet\Parameter|null + * @var Parameter|null */ protected ?Parameter $alpha = null; /** * The memoized input matrix. * - * @var \Tensor\Matrix|null + * @var Matrix|null */ protected ?Matrix $input = null; /** - * @param \Rubix\ML\NeuralNet\Initializers\Initializer|null $initializer + * @param Initializer|null $initializer */ public function __construct(?Initializer $initializer = null) { diff --git a/src/NeuralNet/Layers/Swish.php b/src/NeuralNet/Layers/Swish.php index 4ad02959d..2c60805ce 100644 --- a/src/NeuralNet/Layers/Swish.php +++ b/src/NeuralNet/Layers/Swish.php @@ -52,26 +52,26 @@ class Swish implements Hidden, Parametric /** * The parameterized scaling factors. * - * @var \Rubix\ML\NeuralNet\Parameter|null + * @var Parameter|null */ protected ?Parameter $beta = null; /** * The memoized input matrix. * - * @var \Tensor\Matrix|null + * @var Matrix|null */ protected ?Matrix $input = null; /** * The memorized activation matrix. * - * @var \Tensor\Matrix|null + * @var Matrix|null */ protected ?Matrix $output = null; /** - * @param \Rubix\ML\NeuralNet\Initializers\Initializer|null $initializer + * @param Initializer|null $initializer */ public function __construct(?Initializer $initializer = null) { diff --git a/src/PersistentModel.php b/src/PersistentModel.php index 8aa07ed62..b8b60269f 100644 --- a/src/PersistentModel.php +++ b/src/PersistentModel.php @@ -48,7 +48,7 @@ class PersistentModel implements EstimatorWrapper, Learner, Probabilistic, Scori * Factory method to restore the model from persistence. * * @param Persister $persister - * @param Serializers\Serializer|null $serializer + * @param Serializer|null $serializer * @throws InvalidArgumentException * @return self */ @@ -69,7 +69,7 @@ public static function load(Persister $persister, ?Serializer $serializer = null /** * @param Learner $base * @param Persister $persister - * @param Serializers\Serializer|null $serializer + * @param Serializer|null $serializer * @throws InvalidArgumentException */ public function __construct(Learner $base, Persister $persister, ?Serializer $serializer = null) diff --git a/src/Regressors/Adaline.php b/src/Regressors/Adaline.php index fa29764a9..fcaf06458 100644 --- a/src/Regressors/Adaline.php +++ b/src/Regressors/Adaline.php @@ -109,7 +109,7 @@ class Adaline implements Estimator, Learner, Online, RanksFeatures, Verbose, Per /** * The underlying neural network instance. * - * @var \Rubix\ML\NeuralNet\FeedForward|null + * @var FeedForward|null */ protected ?FeedForward $network = null; @@ -122,12 +122,12 @@ class Adaline implements Estimator, Learner, Online, RanksFeatures, Verbose, Per /** * @param int $batchSize - * @param \Rubix\ML\NeuralNet\Optimizers\Optimizer|null $optimizer + * @param Optimizer|null $optimizer * @param float $l2Penalty * @param int $epochs * @param float $minChange * @param int $window - * @param \Rubix\ML\NeuralNet\CostFunctions\RegressionLoss|null $costFn + * @param RegressionLoss|null $costFn * @throws InvalidArgumentException */ public function __construct( @@ -261,7 +261,7 @@ public function losses() : ?array /** * Return the underlying neural network instance or null if not trained. * - * @return \Rubix\ML\NeuralNet\FeedForward|null + * @return FeedForward|null */ public function network() : ?FeedForward { diff --git a/src/Regressors/GradientBoost.php b/src/Regressors/GradientBoost.php index c7d78e913..0c9ff95c3 100644 --- a/src/Regressors/GradientBoost.php +++ b/src/Regressors/GradientBoost.php @@ -175,14 +175,14 @@ class GradientBoost implements Estimator, Learner, RanksFeatures, Verbose, Persi protected ?float $mu = null; /** - * @param \Rubix\ML\Learner|null $booster + * @param Learner|null $booster * @param float $rate * @param float $ratio * @param int $epochs * @param float $minChange * @param int $window * @param float $holdOut - * @param \Rubix\ML\CrossValidation\Metrics\Metric|null $metric + * @param Metric|null $metric * @throws InvalidArgumentException */ public function __construct( diff --git a/src/Regressors/KDNeighborsRegressor.php b/src/Regressors/KDNeighborsRegressor.php index 7324002ce..659ad5f0c 100644 --- a/src/Regressors/KDNeighborsRegressor.php +++ b/src/Regressors/KDNeighborsRegressor.php @@ -70,7 +70,7 @@ class KDNeighborsRegressor implements Estimator, Learner, Persistable /** * @param int $k * @param bool $weighted - * @param \Rubix\ML\Graph\Trees\Spatial|null $tree + * @param Spatial|null $tree * @throws InvalidArgumentException */ public function __construct(int $k = 5, bool $weighted = false, ?Spatial $tree = null) diff --git a/src/Regressors/KNNRegressor.php b/src/Regressors/KNNRegressor.php index aeaaabe5c..c668fb514 100644 --- a/src/Regressors/KNNRegressor.php +++ b/src/Regressors/KNNRegressor.php @@ -85,7 +85,7 @@ class KNNRegressor implements Estimator, Learner, Online, Persistable /** * @param int $k * @param bool $weighted - * @param \Rubix\ML\Kernels\Distance\Distance|null $kernel + * @param Distance|null $kernel * @throws InvalidArgumentException */ public function __construct(int $k = 5, bool $weighted = false, ?Distance $kernel = null) diff --git a/src/Regressors/MLPRegressor.php b/src/Regressors/MLPRegressor.php index 426cbd754..a9df840d9 100644 --- a/src/Regressors/MLPRegressor.php +++ b/src/Regressors/MLPRegressor.php @@ -138,7 +138,7 @@ class MLPRegressor implements Estimator, Learner, Online, Verbose, Persistable /** * The underlying neural network instance. * - * @var \Rubix\ML\NeuralNet\FeedForward|null + * @var FeedForward|null */ protected ?FeedForward $network = null; @@ -159,14 +159,14 @@ class MLPRegressor implements Estimator, Learner, Online, Verbose, Persistable /** * @param \Rubix\ML\NeuralNet\Layers\Hidden[] $hiddenLayers * @param int $batchSize - * @param \Rubix\ML\NeuralNet\Optimizers\Optimizer|null $optimizer + * @param Optimizer|null $optimizer * @param float $l2Penalty * @param int $epochs * @param float $minChange * @param int $window * @param float $holdOut - * @param \Rubix\ML\NeuralNet\CostFunctions\RegressionLoss|null $costFn - * @param \Rubix\ML\CrossValidation\Metrics\Metric|null $metric + * @param RegressionLoss|null $costFn + * @param Metric|null $metric * @throws InvalidArgumentException */ public function __construct( @@ -336,7 +336,7 @@ public function losses() : ?array /** * Return the underlying neural network instance or null if not trained. * - * @return \Rubix\ML\NeuralNet\FeedForward|null + * @return FeedForward|null */ public function network() : ?FeedForward { diff --git a/src/Regressors/RadiusNeighborsRegressor.php b/src/Regressors/RadiusNeighborsRegressor.php index 2075e7b2e..26c9e9634 100644 --- a/src/Regressors/RadiusNeighborsRegressor.php +++ b/src/Regressors/RadiusNeighborsRegressor.php @@ -78,7 +78,7 @@ class RadiusNeighborsRegressor implements Estimator, Learner, Persistable /** * @param float $radius * @param bool $weighted - * @param \Rubix\ML\Graph\Trees\Spatial|null $tree + * @param Spatial|null $tree * @throws InvalidArgumentException */ public function __construct(float $radius = 1.0, bool $weighted = false, ?Spatial $tree = null) diff --git a/src/Regressors/Ridge.php b/src/Regressors/Ridge.php index 999d3afd5..de3c5944a 100644 --- a/src/Regressors/Ridge.php +++ b/src/Regressors/Ridge.php @@ -56,7 +56,7 @@ class Ridge implements Estimator, Learner, RanksFeatures, Persistable /** * The computed coefficients of the regression line. * - * @var \Tensor\Vector|null + * @var Vector|null */ protected ?Vector $coefficients = null; diff --git a/src/Regressors/SVR.php b/src/Regressors/SVR.php index 5967f6678..4bf161bf0 100644 --- a/src/Regressors/SVR.php +++ b/src/Regressors/SVR.php @@ -62,14 +62,14 @@ class SVR implements Estimator, Learner /** * The trained model instance. * - * @var \svmmodel|null + * @var svmmodel|null */ protected ?svmmodel $model = null; /** * @param float $c * @param float $epsilon - * @param \Rubix\ML\Kernels\SVM\Kernel|null $kernel + * @param Kernel|null $kernel * @param bool $shrinking * @param float $tolerance * @param float $cacheSize diff --git a/src/Traits/LoggerAware.php b/src/Traits/LoggerAware.php index b08e30219..214ffa01c 100644 --- a/src/Traits/LoggerAware.php +++ b/src/Traits/LoggerAware.php @@ -18,14 +18,14 @@ trait LoggerAware /** * The PSR-3 logger instance. * - * @var \Psr\Log\LoggerInterface|null + * @var LoggerInterface|null */ protected ?LoggerInterface $logger = null; /** * Sets a PSR-3 logger instance. * - * @param \Psr\Log\LoggerInterface|null $logger + * @param LoggerInterface|null $logger */ public function setLogger(?LoggerInterface $logger) : void { @@ -35,7 +35,7 @@ public function setLogger(?LoggerInterface $logger) : void /** * Return the PSR-3 logger instance. * - * @return \Psr\Log\LoggerInterface|null + * @return LoggerInterface|null */ public function logger() : ?LoggerInterface { diff --git a/src/Transformers/GaussianRandomProjector.php b/src/Transformers/GaussianRandomProjector.php index ae383213b..30b3a1133 100644 --- a/src/Transformers/GaussianRandomProjector.php +++ b/src/Transformers/GaussianRandomProjector.php @@ -39,7 +39,7 @@ class GaussianRandomProjector implements Transformer, Stateful, Persistable /** * The random matrix. * - * @var \Tensor\Matrix|null + * @var Matrix|null */ protected ?Matrix $r = null; diff --git a/src/Transformers/HotDeckImputer.php b/src/Transformers/HotDeckImputer.php index 9d6633815..fcaaafdd2 100644 --- a/src/Transformers/HotDeckImputer.php +++ b/src/Transformers/HotDeckImputer.php @@ -79,7 +79,7 @@ class HotDeckImputer implements Transformer, Stateful, Persistable * @param int $k * @param bool $weighted * @param string $categoricalPlaceholder - * @param \Rubix\ML\Graph\Trees\Spatial|null $tree + * @param Spatial|null $tree * @throws InvalidArgumentException */ public function __construct( diff --git a/src/Transformers/KNNImputer.php b/src/Transformers/KNNImputer.php index 8bac119ab..971ba7d3e 100644 --- a/src/Transformers/KNNImputer.php +++ b/src/Transformers/KNNImputer.php @@ -86,7 +86,7 @@ class KNNImputer implements Transformer, Stateful, Persistable * @param int $k * @param bool $weighted * @param string $categoricalPlaceholder - * @param \Rubix\ML\Graph\Trees\Spatial|null $tree + * @param Spatial|null $tree * @throws InvalidArgumentException */ public function __construct( diff --git a/src/Transformers/LinearDiscriminantAnalysis.php b/src/Transformers/LinearDiscriminantAnalysis.php index 1a1164d66..0eb56dc85 100644 --- a/src/Transformers/LinearDiscriminantAnalysis.php +++ b/src/Transformers/LinearDiscriminantAnalysis.php @@ -47,7 +47,7 @@ class LinearDiscriminantAnalysis implements Transformer, Stateful, Persistable /** * The matrix of eigenvectors computed at fitting. * - * @var \Tensor\Matrix|null + * @var Matrix|null */ protected ?Matrix $eigenvectors = null; diff --git a/src/Transformers/MissingDataImputer.php b/src/Transformers/MissingDataImputer.php index 71b4cb337..415ac90d1 100644 --- a/src/Transformers/MissingDataImputer.php +++ b/src/Transformers/MissingDataImputer.php @@ -65,8 +65,8 @@ class MissingDataImputer implements Transformer, Stateful, Persistable protected ?array $types = null; /** - * @param \Rubix\ML\Strategies\Strategy|null $continuous - * @param \Rubix\ML\Strategies\Strategy|null $categorical + * @param Strategy|null $continuous + * @param Strategy|null $categorical * @param string $categoricalPlaceholder * @throws InvalidArgumentException */ diff --git a/src/Transformers/PrincipalComponentAnalysis.php b/src/Transformers/PrincipalComponentAnalysis.php index 896795d86..ac9b99f57 100644 --- a/src/Transformers/PrincipalComponentAnalysis.php +++ b/src/Transformers/PrincipalComponentAnalysis.php @@ -51,7 +51,7 @@ class PrincipalComponentAnalysis implements Transformer, Stateful, Persistable /** * The matrix of eigenvectors computed at fitting. * - * @var \Tensor\Matrix|null + * @var Matrix|null */ protected ?Matrix $eigenvectors = null; diff --git a/src/Transformers/TSNE.php b/src/Transformers/TSNE.php index dc39961fb..dcf99e15b 100644 --- a/src/Transformers/TSNE.php +++ b/src/Transformers/TSNE.php @@ -207,7 +207,7 @@ class TSNE implements Transformer, Verbose * @param int $epochs * @param float $minGradient * @param int $window - * @param \Rubix\ML\Kernels\Distance\Distance|null $kernel + * @param Distance|null $kernel * @throws InvalidArgumentException */ public function __construct( diff --git a/src/Transformers/TokenHashingVectorizer.php b/src/Transformers/TokenHashingVectorizer.php index a0eb0d45b..3c994bc24 100644 --- a/src/Transformers/TokenHashingVectorizer.php +++ b/src/Transformers/TokenHashingVectorizer.php @@ -103,7 +103,7 @@ public static function fnv1(string $input) : int /** * @param int $dimensions - * @param \Rubix\ML\Tokenizers\Tokenizer|null $tokenizer + * @param Tokenizer|null $tokenizer * @param callable(string):int|null $hashFn * @throws InvalidArgumentException */ diff --git a/src/Transformers/TruncatedSVD.php b/src/Transformers/TruncatedSVD.php index 143f570be..345679213 100644 --- a/src/Transformers/TruncatedSVD.php +++ b/src/Transformers/TruncatedSVD.php @@ -47,7 +47,7 @@ class TruncatedSVD implements Transformer, Stateful, Persistable /** * The transposed right singular vectors of the decomposition. * - * @var \Tensor\Matrix|null + * @var Matrix|null */ protected ?Matrix $components = null; diff --git a/src/Transformers/WordCountVectorizer.php b/src/Transformers/WordCountVectorizer.php index 9545f560b..74b335b3b 100644 --- a/src/Transformers/WordCountVectorizer.php +++ b/src/Transformers/WordCountVectorizer.php @@ -75,7 +75,7 @@ class WordCountVectorizer implements Transformer, Stateful, Persistable * @param int $maxVocabularySize * @param int $minDocumentCount * @param float $maxDocumentRatio - * @param \Rubix\ML\Tokenizers\Tokenizer|null $tokenizer + * @param Tokenizer|null $tokenizer */ public function __construct( int $maxVocabularySize = PHP_INT_MAX, diff --git a/src/Verbose.php b/src/Verbose.php index a332f6cd8..0033d8b58 100644 --- a/src/Verbose.php +++ b/src/Verbose.php @@ -17,7 +17,7 @@ interface Verbose extends LoggerAwareInterface /** * Return the logger or null if not set. * - * @return \Psr\Log\LoggerInterface|null + * @return LoggerInterface|null */ public function logger() : ?LoggerInterface; }