mirror of
https://github.com/Llewellynvdm/php-ml.git
synced 2025-01-23 23:28:24 +00:00
test exception on kmeans
This commit is contained in:
parent
448eaafd78
commit
403824d23b
@ -13,5 +13,4 @@ class NormalizerException extends \Exception
|
||||
{
|
||||
return new self('Unknown norm supplied.');
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -48,4 +48,12 @@ class KMeansTest extends \PHPUnit_Framework_TestCase
|
||||
$clusters = $kmeans->cluster($samples);
|
||||
$this->assertEquals(4, count($clusters));
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \Phpml\Exception\InvalidArgumentException
|
||||
*/
|
||||
public function testThrowExceptionOnInvalidClusterNumber()
|
||||
{
|
||||
new KMeans(0);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user