2016-04-06 19:46:17 +00:00
|
|
|
<?php
|
2016-04-06 20:38:08 +00:00
|
|
|
|
|
|
|
declare (strict_types = 1);
|
2016-04-06 19:46:17 +00:00
|
|
|
|
2016-04-07 20:12:36 +00:00
|
|
|
namespace tests\Phpml\Dataset\Demo;
|
2016-04-06 19:46:17 +00:00
|
|
|
|
2016-09-30 12:02:08 +00:00
|
|
|
use Phpml\Dataset\Demo\IrisDataset;
|
2016-04-06 19:46:17 +00:00
|
|
|
|
2016-09-30 12:02:08 +00:00
|
|
|
class IrisDatasetTest extends \PHPUnit_Framework_TestCase
|
2016-04-06 19:46:17 +00:00
|
|
|
{
|
|
|
|
public function testLoadingIrisDataset()
|
|
|
|
{
|
2016-09-30 12:02:08 +00:00
|
|
|
$iris = new IrisDataset();
|
2016-04-06 19:46:17 +00:00
|
|
|
|
|
|
|
// whole dataset
|
|
|
|
$this->assertEquals(150, count($iris->getSamples()));
|
2016-06-16 21:56:15 +00:00
|
|
|
$this->assertEquals(150, count($iris->getTargets()));
|
2016-04-06 19:46:17 +00:00
|
|
|
|
|
|
|
// one sample features count
|
|
|
|
$this->assertEquals(4, count($iris->getSamples()[0]));
|
|
|
|
}
|
2016-04-06 20:38:08 +00:00
|
|
|
}
|