Skip to content

Commit 0226b3f

Browse files
Update stack
1 parent ca59648 commit 0226b3f

File tree

372 files changed

+7123
-12456
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

372 files changed

+7123
-12456
lines changed

.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
strategy:
1010
matrix:
1111
operating-system: [windows-latest, ubuntu-latest, macos-latest]
12-
php-versions: ['8.0', '8.1', '8.2']
12+
php-versions: ['8.4']
1313

1414
steps:
1515
- name: Checkout

composer.json

+9-9
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"svm", "text mining", "tf-idf", "tf idf", "t-sne", "tsne", "unsupervised learning"
2222
],
2323
"authors": [
24-
{
24+
{
2525
"name": "Andrew DalPino",
2626
"homepage": "https://github.com/andrewdalpino"
2727
},
@@ -31,32 +31,32 @@
3131
}
3232
],
3333
"require": {
34-
"php": ">=8.0",
34+
"php": ">=8.4",
3535
"ext-json": "*",
36+
"ext-numpower": ">=0.6",
3637
"amphp/parallel": "^1.3",
3738
"andrewdalpino/okbloomer": "^1.0",
39+
"numpower/numpower": "^0.6",
3840
"psr/log": "^1.1|^2.0|^3.0",
3941
"rubix/tensor": "^3.0",
4042
"symfony/polyfill-mbstring": "^1.0",
41-
"symfony/polyfill-php81": "^1.26",
42-
"symfony/polyfill-php82": "^1.27",
43-
"symfony/polyfill-php83": "^1.27",
4443
"wamania/php-stemmer": "^3.0"
4544
},
4645
"require-dev": {
4746
"friendsofphp/php-cs-fixer": "^3.0",
4847
"phpbench/phpbench": "^1.0",
4948
"phpstan/extension-installer": "^1.0",
50-
"phpstan/phpstan": "^1.0",
51-
"phpstan/phpstan-phpunit": "^1.0",
52-
"phpunit/phpunit": "^9.0",
49+
"phpstan/phpstan": "^2.0",
50+
"phpstan/phpstan-phpunit": "^2.0",
51+
"phpunit/phpunit": "^11.0",
5352
"swoole/ide-helper": "^5.1"
5453
},
5554
"suggest": {
5655
"ext-tensor": "For fast Matrix/Vector computing",
5756
"ext-gd": "For image support",
5857
"ext-mbstring": "For fast multibyte string manipulation",
59-
"ext-svm": "For Support Vector Machine engine (libsvm)"
58+
"ext-svm": "For support Vector Machine engine (libsvm)",
59+
"ext-swoole": "For support Swoole runner"
6060
},
6161
"autoload": {
6262
"psr-4": {

phpunit.xml

+16-12
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,33 @@
22
<phpunit
33
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
44
backupGlobals="false"
5-
backupStaticAttributes="false"
65
bootstrap="vendor/autoload.php"
76
colors="true"
8-
convertErrorsToExceptions="true"
9-
convertNoticesToExceptions="true"
10-
convertWarningsToExceptions="true"
11-
forceCoversAnnotation="true"
7+
displayDetailsOnTestsThatTriggerDeprecations="true"
8+
displayDetailsOnTestsThatTriggerNotices="true"
9+
displayDetailsOnTestsThatTriggerWarnings="true"
10+
displayDetailsOnTestsThatTriggerErrors="true"
11+
displayDetailsOnSkippedTests="true"
1212
processIsolation="true"
1313
stopOnFailure="false"
14+
testdox="true"
1415
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
1516
>
16-
<coverage processUncoveredFiles="true">
17+
<source>
1718
<include>
1819
<directory suffix=".php">src</directory>
1920
</include>
20-
</coverage>
21+
</source>
2122
<testsuites>
22-
<testsuite name="Base">
23-
<directory>tests</directory>
24-
</testsuite>
2523
<testsuite name="Anomaly Detectors">
2624
<directory>tests/AnomalyDetectors</directory>
2725
</testsuite>
2826
<testsuite name="Backends">
2927
<directory>tests/Backends</directory>
3028
</testsuite>
29+
<testsuite name="Base">
30+
<directory>tests/Base</directory>
31+
</testsuite>
3132
<testsuite name="Classifiers">
3233
<directory>tests/Classifiers</directory>
3334
</testsuite>
@@ -55,7 +56,7 @@
5556
<testsuite name="Loggers">
5657
<directory>tests/Loggers</directory>
5758
</testsuite>
58-
<testsuite name="Neural Net">
59+
<testsuite name="NeuralNet">
5960
<directory>tests/NeuralNet</directory>
6061
</testsuite>
6162
<testsuite name="Persisters">
@@ -64,14 +65,17 @@
6465
<testsuite name="Regressors">
6566
<directory>tests/Regressors</directory>
6667
</testsuite>
68+
<testsuite name="Serializers">
69+
<directory>tests/Serializers</directory>
70+
</testsuite>
6771
<testsuite name="Specifications">
6872
<directory>tests/Specifications</directory>
6973
</testsuite>
7074
<testsuite name="Strategies">
7175
<directory>tests/Strategies</directory>
7276
</testsuite>
7377
<testsuite name="Tokenizers">
74-
<directory>tests/Transformers</directory>
78+
<directory>tests/Tokenizers</directory>
7579
</testsuite>
7680
<testsuite name="Transformers">
7781
<directory>tests/Transformers</directory>

src/AnomalyDetectors/GaussianMLE.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ public function type() : EstimatorType
133133
*
134134
* @internal
135135
*
136-
* @return list<\Rubix\ML\DataType>
136+
* @return list<DataType>
137137
*/
138138
public function compatibility() : array
139139
{

src/AnomalyDetectors/IsolationForest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ class IsolationForest implements Estimator, Learner, Scoring, Persistable
9797
/**
9898
* The isolation trees that make up the forest.
9999
*
100-
* @var \Rubix\ML\Graph\Trees\ITree[]
100+
* @var ITree[]
101101
*/
102102
protected array $trees = [
103103
//
@@ -162,7 +162,7 @@ public function type() : EstimatorType
162162
*
163163
* @internal
164164
*
165-
* @return list<\Rubix\ML\DataType>
165+
* @return list<DataType>
166166
*/
167167
public function compatibility() : array
168168
{

src/AnomalyDetectors/Loda.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ public function type() : EstimatorType
171171
*
172172
* @internal
173173
*
174-
* @return list<\Rubix\ML\DataType>
174+
* @return list<DataType>
175175
*/
176176
public function compatibility() : array
177177
{

src/AnomalyDetectors/OneClassSVM.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ public function type() : EstimatorType
139139
*
140140
* @internal
141141
*
142-
* @return list<\Rubix\ML\DataType>
142+
* @return list<DataType>
143143
*/
144144
public function compatibility() : array
145145
{

src/AnomalyDetectors/RobustZScore.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ public function type() : EstimatorType
138138
*
139139
* @internal
140140
*
141-
* @return list<\Rubix\ML\DataType>
141+
* @return list<DataType>
142142
*/
143143
public function compatibility() : array
144144
{

src/Backends/Amp.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public function enqueue(Task $task, ?callable $after = null, mixed $context = nu
104104
* @param AmpTask $task
105105
* @param callable(mixed,mixed):void $after
106106
* @param mixed $context
107-
* @return \Generator<\Amp\Promise>
107+
* @return Generator<\Amp\Promise>
108108
*/
109109
public function coroutine(AmpTask $task, ?callable $after = null, mixed $context = null) : Generator
110110
{
@@ -138,7 +138,7 @@ public function process() : array
138138
*
139139
* @internal
140140
*
141-
* @return \Generator<\Amp\Promise>
141+
* @return Generator<\Amp\Promise>
142142
*/
143143
public function gather() : Generator
144144
{

src/Backends/Swoole.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
use Swoole\Atomic;
1010
use Swoole\Process;
1111

12-
use function Swoole\Coroutine\run;
13-
1412
/**
1513
* Swoole
1614
*
@@ -110,7 +108,7 @@ function (Process $worker) use ($maxMessageLength, $queueItem) {
110108
$currentCpu = ($currentCpu + 1) % $this->cpus;
111109
}
112110

113-
run(function () use ($maxMessageLength, &$results, $workerProcesses) {
111+
Coroutine::run(function () use ($maxMessageLength, &$results, $workerProcesses) {
114112
foreach ($workerProcesses as $index => $workerProcess) {
115113
$status = $workerProcess->wait();
116114

src/BootstrapAggregator.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class BootstrapAggregator implements Estimator, Learner, Parallel, Persistable
8383
/**
8484
* The ensemble of estimators.
8585
*
86-
* @var list<\Rubix\ML\Learner>
86+
* @var list<Learner>
8787
*/
8888
protected array $ensemble = [
8989
//
@@ -136,7 +136,7 @@ public function type() : EstimatorType
136136
*
137137
* @internal
138138
*
139-
* @return list<\Rubix\ML\DataType>
139+
* @return list<DataType>
140140
*/
141141
public function compatibility() : array
142142
{

src/Classifiers/AdaBoost.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ class AdaBoost implements Estimator, Learner, Probabilistic, Verbose, Persistabl
112112
/**
113113
* The ensemble of *weak* classifiers.
114114
*
115-
* @var \Rubix\ML\Learner[]|null
115+
* @var Learner[]|null
116116
*/
117117
protected ?array $ensemble = null;
118118

@@ -255,7 +255,7 @@ public function trained() : bool
255255
/**
256256
* Return an iterable progress table with the steps from the last training session.
257257
*
258-
* @return \Generator<mixed[]>
258+
* @return Generator<mixed[]>
259259
*/
260260
public function steps() : Generator
261261
{

src/Classifiers/ClassificationTree.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public function type() : EstimatorType
9494
*
9595
* @internal
9696
*
97-
* @return list<\Rubix\ML\DataType>
97+
* @return list<DataType>
9898
*/
9999
public function compatibility() : array
100100
{

src/Classifiers/ExtraTreeClassifier.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public function type() : EstimatorType
9393
*
9494
* @internal
9595
*
96-
* @return list<\Rubix\ML\DataType>
96+
* @return list<DataType>
9797
*/
9898
public function compatibility() : array
9999
{

src/Classifiers/GaussianNB.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ public function type() : EstimatorType
161161
*
162162
* @internal
163163
*
164-
* @return list<\Rubix\ML\DataType>
164+
* @return list<DataType>
165165
*/
166166
public function compatibility() : array
167167
{

src/Classifiers/LogisticRegression.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ public function type() : EstimatorType
196196
*
197197
* @internal
198198
*
199-
* @return list<\Rubix\ML\DataType>
199+
* @return list<DataType>
200200
*/
201201
public function compatibility() : array
202202
{
@@ -238,7 +238,7 @@ public function trained() : bool
238238
/**
239239
* Return an iterable progress table with the steps from the last training session.
240240
*
241-
* @return \Generator<mixed[]>
241+
* @return Generator<mixed[]>
242242
*/
243243
public function steps() : Generator
244244
{

src/Classifiers/LogitBoost.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ public function trained() : bool
321321
/**
322322
* Return an iterable progress table with the steps from the last training session.
323323
*
324-
* @return \Generator<mixed[]>
324+
* @return Generator<mixed[]>
325325
*/
326326
public function steps() : Generator
327327
{

src/Classifiers/MultilayerPerceptron.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class MultilayerPerceptron implements Estimator, Learner, Online, Probabilistic,
6969
/**
7070
* An array composing the user-specified hidden layers of the network in order.
7171
*
72-
* @var \Rubix\ML\NeuralNet\Layers\Hidden[]
72+
* @var Hidden[]
7373
*/
7474
protected array $hiddenLayers;
7575

@@ -165,7 +165,7 @@ class MultilayerPerceptron implements Estimator, Learner, Online, Probabilistic,
165165
protected ?array $losses = null;
166166

167167
/**
168-
* @param \Rubix\ML\NeuralNet\Layers\Hidden[] $hiddenLayers
168+
* @param Hidden[] $hiddenLayers
169169
* @param int $batchSize
170170
* @param Optimizer|null $optimizer
171171
* @param int $epochs
@@ -259,7 +259,7 @@ public function type() : EstimatorType
259259
*
260260
* @internal
261261
*
262-
* @return list<\Rubix\ML\DataType>
262+
* @return list<DataType>
263263
*/
264264
public function compatibility() : array
265265
{
@@ -304,7 +304,7 @@ public function trained() : bool
304304
/**
305305
* Return an iterable progress table with the steps from the last training session.
306306
*
307-
* @return \Generator<mixed[]>
307+
* @return Generator<mixed[]>
308308
*/
309309
public function steps() : Generator
310310
{

src/Classifiers/NaiveBayes.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ public function type() : EstimatorType
151151
*
152152
* @internal
153153
*
154-
* @return list<\Rubix\ML\DataType>
154+
* @return list<DataType>
155155
*/
156156
public function compatibility() : array
157157
{

src/Classifiers/OneVsRest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class OneVsRest implements Estimator, Learner, Probabilistic, Parallel, Persista
5656
/**
5757
* A map of each class to its binary classifier.
5858
*
59-
* @var array<\Rubix\ML\Learner>
59+
* @var array<Learner>
6060
*/
6161
protected array $classifiers = [
6262
//

src/Classifiers/SVC.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ public function type() : EstimatorType
150150
*
151151
* @internal
152152
*
153-
* @return list<\Rubix\ML\DataType>
153+
* @return list<DataType>
154154
*/
155155
public function compatibility() : array
156156
{

src/Classifiers/SoftmaxClassifier.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ public function type() : EstimatorType
192192
*
193193
* @internal
194194
*
195-
* @return list<\Rubix\ML\DataType>
195+
* @return list<DataType>
196196
*/
197197
public function compatibility() : array
198198
{
@@ -234,7 +234,7 @@ public function trained() : bool
234234
/**
235235
* Return an iterable progress table with the steps from the last training session.
236236
*
237-
* @return \Generator<mixed[]>
237+
* @return Generator<mixed[]>
238238
*/
239239
public function steps() : Generator
240240
{

0 commit comments

Comments
 (0)