Rename demo datasets and add Dataset suffix

This commit is contained in:
Arkadiusz Kondas 2016-09-30 14:02:08 +02:00
parent 84af842f04
commit 349ea16f01
7 changed files with 14 additions and 14 deletions

View File

@ -18,7 +18,7 @@ use Phpml\Dataset\CsvDataset;
* Samples total: 214
* Features per sample: 9.
*/
class Glass extends CsvDataset
class GlassDataset extends CsvDataset
{
public function __construct()
{

View File

@ -12,7 +12,7 @@ use Phpml\Dataset\CsvDataset;
* Samples total: 150
* Features per sample: 4.
*/
class Iris extends CsvDataset
class IrisDataset extends CsvDataset
{
public function __construct()
{

View File

@ -12,7 +12,7 @@ use Phpml\Dataset\CsvDataset;
* Samples total: 178
* Features per sample: 13.
*/
class Wine extends CsvDataset
class WineDataset extends CsvDataset
{
public function __construct()
{

View File

@ -4,13 +4,13 @@ declare (strict_types = 1);
namespace tests\Phpml\Dataset\Demo;
use Phpml\Dataset\Demo\Glass;
use Phpml\Dataset\Demo\GlassDataset;
class GlassTest extends \PHPUnit_Framework_TestCase
class GlassDatasetTest extends \PHPUnit_Framework_TestCase
{
public function testLoadingWineDataset()
{
$glass = new Glass();
$glass = new GlassDataset();
// whole dataset
$this->assertEquals(214, count($glass->getSamples()));

View File

@ -4,13 +4,13 @@ declare (strict_types = 1);
namespace tests\Phpml\Dataset\Demo;
use Phpml\Dataset\Demo\Iris;
use Phpml\Dataset\Demo\IrisDataset;
class IrisTest extends \PHPUnit_Framework_TestCase
class IrisDatasetTest extends \PHPUnit_Framework_TestCase
{
public function testLoadingIrisDataset()
{
$iris = new Iris();
$iris = new IrisDataset();
// whole dataset
$this->assertEquals(150, count($iris->getSamples()));

View File

@ -4,13 +4,13 @@ declare (strict_types = 1);
namespace tests\Phpml\Dataset\Demo;
use Phpml\Dataset\Demo\Wine;
use Phpml\Dataset\Demo\WineDataset;
class WineTest extends \PHPUnit_Framework_TestCase
class WineDatasetTest extends \PHPUnit_Framework_TestCase
{
public function testLoadingWineDataset()
{
$wine = new Wine();
$wine = new WineDataset();
// whole dataset
$this->assertEquals(178, count($wine->getSamples()));

View File

@ -6,7 +6,7 @@ namespace tests\Phpml\Metric;
use Phpml\Classification\SVC;
use Phpml\CrossValidation\RandomSplit;
use Phpml\Dataset\Demo\Iris;
use Phpml\Dataset\Demo\IrisDataset;
use Phpml\Metric\Accuracy;
use Phpml\SupportVectorMachine\Kernel;
@ -41,7 +41,7 @@ class AccuracyTest extends \PHPUnit_Framework_TestCase
public function testAccuracyOnDemoDataset()
{
$dataset = new RandomSplit(new Iris(), 0.5, 123);
$dataset = new RandomSplit(new IrisDataset(), 0.5, 123);
$classifier = new SVC(Kernel::RBF);
$classifier->train($dataset->getTrainSamples(), $dataset->getTrainLabels());