| 1 | <?php |
||
| 7 | class Pipeline implements Estimator |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * @var array|Transformer[] |
||
| 11 | */ |
||
| 12 | private $transformers; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * @var Estimator |
||
| 16 | */ |
||
| 17 | private $estimator; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * @param array|Transformer[] $transformers |
||
| 21 | * @param Estimator $estimator |
||
| 22 | */ |
||
| 23 | public function __construct(array $transformers = [], Estimator $estimator) |
||
| 31 | |||
| 32 | /** |
||
| 33 | * @param Transformer $transformer |
||
| 34 | */ |
||
| 35 | public function addTransformer(Transformer $transformer) |
||
| 39 | |||
| 40 | /** |
||
| 41 | * @param Estimator $estimator |
||
| 42 | */ |
||
| 43 | public function setEstimator(Estimator $estimator) |
||
| 47 | |||
| 48 | /** |
||
| 49 | * @return array|Transformer[] |
||
| 50 | */ |
||
| 51 | public function getTransformers() |
||
| 55 | |||
| 56 | /** |
||
| 57 | * @return Estimator |
||
| 58 | */ |
||
| 59 | public function getEstimator() |
||
| 63 | |||
| 64 | /** |
||
| 65 | * @param array $samples |
||
| 66 | * @param array $targets |
||
| 67 | */ |
||
| 68 | public function train(array $samples, array $targets) |
||
| 76 | |||
| 77 | /** |
||
| 78 | * @param array $samples |
||
| 79 | * |
||
| 80 | * @return mixed |
||
| 81 | */ |
||
| 82 | public function predict(array $samples) |
||
| 86 | } |
||
| 87 |