Skip to content

Commit 37a4a58

Browse files
committed
Fix brute-force neighbors return type-hint
1 parent 14eed45 commit 37a4a58

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/Classifiers/KNearestNeighbors.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -290,11 +290,10 @@ public function probaSample(array $sample) : array
290290
}
291291

292292
/**
293-
* Find the K nearest neighbors to the given sample vector using
294-
* the brute force method.
293+
* Find the K nearest neighbors to the given sample vector using the brute force method.
295294
*
296295
* @param list<string|int|float> $sample
297-
* @return list<list<string|int|float>>
296+
* @return array{list<string|int|float>,list<float>}
298297
*/
299298
protected function nearest(array $sample) : array
300299
{

src/Regressors/KNNRegressor.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -224,11 +224,10 @@ public function predictSample(array $sample)
224224
}
225225

226226
/**
227-
* Find the K nearest neighbors to the given sample vector using
228-
* the brute force method.
227+
* Find the K nearest neighbors to the given sample vector using the brute force method.
229228
*
230229
* @param (string|int|float)[] $sample
231-
* @return array<(string|int|float)[]>
230+
* @return array{list<string|int|float>,list<float>}
232231
*/
233232
protected function nearest(array $sample) : array
234233
{

0 commit comments

Comments
 (0)