2016-06-16 07:58:17 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare (strict_types = 1);
|
|
|
|
|
|
|
|
namespace tests;
|
|
|
|
|
|
|
|
use Phpml\Classification\SVC;
|
|
|
|
use Phpml\FeatureExtraction\TfIdfTransformer;
|
|
|
|
use Phpml\Pipeline;
|
|
|
|
|
|
|
|
class PipelineTest extends \PHPUnit_Framework_TestCase
|
|
|
|
{
|
|
|
|
public function testPipelineConstruction()
|
|
|
|
{
|
|
|
|
$transformers = [
|
2016-06-16 08:01:40 +00:00
|
|
|
new TfIdfTransformer(),
|
2016-06-16 07:58:17 +00:00
|
|
|
];
|
|
|
|
$estimator = new SVC();
|
|
|
|
|
|
|
|
$pipeline = new Pipeline($transformers, $estimator);
|
|
|
|
|
|
|
|
$this->assertEquals($transformers, $pipeline->getTransformers());
|
|
|
|
$this->assertEquals($estimator, $pipeline->getEstimator());
|
|
|
|
}
|
|
|
|
}
|