mirror of
https://github.com/Llewellynvdm/php-ml.git
synced 2024-11-21 20:45:10 +00:00
Fix 'toSmall' typo (#234)
This commit is contained in:
parent
451f84c2e6
commit
6ac61a860c
@ -23,7 +23,7 @@ class InvalidArgumentException extends Exception
|
||||
return new self('The array has zero elements');
|
||||
}
|
||||
|
||||
public static function arraySizeToSmall(int $minimumSize = 2): self
|
||||
public static function arraySizeTooSmall(int $minimumSize = 2): self
|
||||
{
|
||||
return new self(sprintf('The array must have at least %d elements', $minimumSize));
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ final class ANOVA
|
||||
{
|
||||
$classes = count($samples);
|
||||
if ($classes < 2) {
|
||||
throw InvalidArgumentException::arraySizeToSmall(2);
|
||||
throw InvalidArgumentException::arraySizeTooSmall(2);
|
||||
}
|
||||
|
||||
$samplesPerClass = array_map(function (array $class): int {
|
||||
|
@ -21,7 +21,7 @@ class Covariance
|
||||
|
||||
$n = count($x);
|
||||
if ($sample && $n === 1) {
|
||||
throw InvalidArgumentException::arraySizeToSmall(2);
|
||||
throw InvalidArgumentException::arraySizeTooSmall(2);
|
||||
}
|
||||
|
||||
if ($meanX === null) {
|
||||
@ -59,7 +59,7 @@ class Covariance
|
||||
|
||||
$n = count($data);
|
||||
if ($sample && $n === 1) {
|
||||
throw InvalidArgumentException::arraySizeToSmall(2);
|
||||
throw InvalidArgumentException::arraySizeTooSmall(2);
|
||||
}
|
||||
|
||||
if ($i < 0 || $k < 0 || $i >= $n || $k >= $n) {
|
||||
|
@ -20,7 +20,7 @@ class StandardDeviation
|
||||
$n = count($numbers);
|
||||
|
||||
if ($sample && $n === 1) {
|
||||
throw InvalidArgumentException::arraySizeToSmall(2);
|
||||
throw InvalidArgumentException::arraySizeTooSmall(2);
|
||||
}
|
||||
|
||||
$mean = Mean::arithmetic($numbers);
|
||||
|
@ -11,7 +11,7 @@ use PHPUnit\Framework\TestCase;
|
||||
|
||||
class RandomSplitTest extends TestCase
|
||||
{
|
||||
public function testThrowExceptionOnToSmallTestSize(): void
|
||||
public function testThrowExceptionOnTooSmallTestSize(): void
|
||||
{
|
||||
$this->expectException(InvalidArgumentException::class);
|
||||
new RandomSplit(new ArrayDataset([], []), 0);
|
||||
|
@ -32,7 +32,7 @@ final class ANOVATest extends TestCase
|
||||
self::assertEquals([0.6, 2.4, 1.24615385], ANOVA::oneWayF($samples), '', 0.00000001);
|
||||
}
|
||||
|
||||
public function testThrowExceptionOnToSmallSamples(): void
|
||||
public function testThrowExceptionOnTooSmallSamples(): void
|
||||
{
|
||||
$this->expectException(InvalidArgumentException::class);
|
||||
$samples = [
|
||||
|
@ -73,7 +73,7 @@ class CovarianceTest extends TestCase
|
||||
Covariance::fromXYArrays([1, 2, 3], []);
|
||||
}
|
||||
|
||||
public function testThrowExceptionOnToSmallArrayIfSample(): void
|
||||
public function testThrowExceptionOnTooSmallArrayIfSample(): void
|
||||
{
|
||||
$this->expectException(InvalidArgumentException::class);
|
||||
Covariance::fromXYArrays([1], [2], true);
|
||||
@ -85,7 +85,7 @@ class CovarianceTest extends TestCase
|
||||
Covariance::fromDataset([], 0, 1);
|
||||
}
|
||||
|
||||
public function testThrowExceptionOnToSmallDatasetIfSample(): void
|
||||
public function testThrowExceptionOnTooSmallDatasetIfSample(): void
|
||||
{
|
||||
$this->expectException(InvalidArgumentException::class);
|
||||
Covariance::fromDataset([1], 0, 1);
|
||||
|
@ -32,7 +32,7 @@ class StandardDeviationTest extends TestCase
|
||||
StandardDeviation::population([], false);
|
||||
}
|
||||
|
||||
public function testThrowExceptionOnToSmallArray(): void
|
||||
public function testThrowExceptionOnTooSmallArray(): void
|
||||
{
|
||||
$this->expectException(InvalidArgumentException::class);
|
||||
StandardDeviation::population([1]);
|
||||
|
Loading…
Reference in New Issue
Block a user