diff --git a/src/Phpml/Classification/Classifier.php b/src/Phpml/Classification/Classifier.php index 00e6779..1477904 100644 --- a/src/Phpml/Classification/Classifier.php +++ b/src/Phpml/Classification/Classifier.php @@ -4,18 +4,8 @@ declare (strict_types = 1); namespace Phpml\Classification; -interface Classifier -{ - /** - * @param array $samples - * @param array $labels - */ - public function train(array $samples, array $labels); +use Phpml\Estimator; - /** - * @param array $samples - * - * @return mixed - */ - public function predict(array $samples); +interface Classifier extends Estimator +{ } diff --git a/src/Phpml/Estimator.php b/src/Phpml/Estimator.php new file mode 100644 index 0000000..0631679 --- /dev/null +++ b/src/Phpml/Estimator.php @@ -0,0 +1,21 @@ +stages = $stages; + } + + /** + * @param mixed $stage + */ + public function addStage($stage) + { + $this->stages[] = $stage; + } +} diff --git a/src/Phpml/Regression/Regression.php b/src/Phpml/Regression/Regression.php index 12d2f52..27a1b83 100644 --- a/src/Phpml/Regression/Regression.php +++ b/src/Phpml/Regression/Regression.php @@ -4,18 +4,8 @@ declare (strict_types = 1); namespace Phpml\Regression; -interface Regression -{ - /** - * @param array $samples - * @param array $targets - */ - public function train(array $samples, array $targets); +use Phpml\Estimator; - /** - * @param array $samples - * - * @return mixed - */ - public function predict(array $samples); +interface Regression extends Estimator +{ } diff --git a/src/Phpml/FeatureExtraction/Transformer.php b/src/Phpml/Transformer.php similarity index 84% rename from src/Phpml/FeatureExtraction/Transformer.php rename to src/Phpml/Transformer.php index 13eb955..bdc809b 100644 --- a/src/Phpml/FeatureExtraction/Transformer.php +++ b/src/Phpml/Transformer.php @@ -2,7 +2,7 @@ declare (strict_types = 1); -namespace Phpml\FeatureExtraction; +namespace Phpml; interface Transformer {