2016-04-06 19:46:17 +00:00
|
|
|
<?php
|
2016-04-06 20:38:08 +00:00
|
|
|
|
2016-11-20 21:53:17 +00:00
|
|
|
declare(strict_types=1);
|
2016-04-06 19:46:17 +00:00
|
|
|
|
2018-01-06 12:09:33 +00:00
|
|
|
namespace Phpml\Tests\Dataset\Demo;
|
2016-04-06 19:46:17 +00:00
|
|
|
|
2016-09-30 12:02:08 +00:00
|
|
|
use Phpml\Dataset\Demo\IrisDataset;
|
2017-02-03 11:58:25 +00:00
|
|
|
use PHPUnit\Framework\TestCase;
|
2016-04-06 19:46:17 +00:00
|
|
|
|
2017-02-03 11:58:25 +00:00
|
|
|
class IrisDatasetTest extends TestCase
|
2016-04-06 19:46:17 +00:00
|
|
|
{
|
2017-11-14 20:21:23 +00:00
|
|
|
public function testLoadingIrisDataset(): void
|
2016-04-06 19:46:17 +00:00
|
|
|
{
|
2016-09-30 12:02:08 +00:00
|
|
|
$iris = new IrisDataset();
|
2016-04-06 19:46:17 +00:00
|
|
|
|
|
|
|
// whole dataset
|
2016-12-12 18:31:30 +00:00
|
|
|
$this->assertCount(150, $iris->getSamples());
|
|
|
|
$this->assertCount(150, $iris->getTargets());
|
2016-04-06 19:46:17 +00:00
|
|
|
|
|
|
|
// one sample features count
|
2016-12-12 18:31:30 +00:00
|
|
|
$this->assertCount(4, $iris->getSamples()[0]);
|
2016-04-06 19:46:17 +00:00
|
|
|
}
|
2016-04-06 20:38:08 +00:00
|
|
|
}
|