php-ml/tests/Dataset/Demo/IrisDatasetTest.php

24 lines
504 B
PHP
Raw Normal View History

2016-04-06 21:46:17 +02:00
<?php
2016-11-20 22:53:17 +01:00
declare(strict_types=1);
2016-04-06 21:46:17 +02:00
namespace Phpml\Tests\Dataset\Demo;
2016-04-06 21:46:17 +02:00
use Phpml\Dataset\Demo\IrisDataset;
2017-02-03 12:58:25 +01:00
use PHPUnit\Framework\TestCase;
2016-04-06 21:46:17 +02:00
2017-02-03 12:58:25 +01:00
class IrisDatasetTest extends TestCase
2016-04-06 21:46:17 +02:00
{
public function testLoadingIrisDataset(): void
2016-04-06 21:46:17 +02:00
{
$iris = new IrisDataset();
2016-04-06 21:46:17 +02:00
// whole dataset
2018-10-28 07:44:52 +01:00
self::assertCount(150, $iris->getSamples());
self::assertCount(150, $iris->getTargets());
2016-04-06 21:46:17 +02:00
// one sample features count
2018-10-28 07:44:52 +01:00
self::assertCount(4, $iris->getSamples()[0]);
2016-04-06 21:46:17 +02:00
}
}