diff --git a/src/Phpml/Classifier/SupportVectorMachine.php b/src/Phpml/Classifier/SupportVectorMachine.php index e16ebbe..8ee3731 100644 --- a/src/Phpml/Classifier/SupportVectorMachine.php +++ b/src/Phpml/Classifier/SupportVectorMachine.php @@ -34,9 +34,9 @@ class SupportVectorMachine implements Classifier /** * @param Kernel $kernel - * @param float $C - * @param float $tolerance - * @param int $upperBound + * @param float $C + * @param float $tolerance + * @param int $upperBound */ public function __construct(Kernel $kernel = null, float $C = 1.0, float $tolerance = .001, int $upperBound = 100) { diff --git a/src/Phpml/Math/Kernel.php b/src/Phpml/Math/Kernel.php index 776f78c..953a5fa 100644 --- a/src/Phpml/Math/Kernel.php +++ b/src/Phpml/Math/Kernel.php @@ -1,11 +1,11 @@ features = $features; + $this->targets = $targets; + } + + /** + * @param array $features + * + * @return mixed + */ + public function predict(array $features) + { + } +} diff --git a/src/Phpml/Regression/Regression.php b/src/Phpml/Regression/Regression.php new file mode 100644 index 0000000..34e0b6d --- /dev/null +++ b/src/Phpml/Regression/Regression.php @@ -0,0 +1,21 @@ +assertEquals(0.00451, $rbf->compute([1, 2, 3], [4, 5, 6]), '', $delta = 0.0001); $this->assertEquals(0, $rbf->compute([4, 5], [1, 100])); } - } diff --git a/tests/Phpml/Math/ProductTest.php b/tests/Phpml/Math/ProductTest.php index ade9942..aba0ff2 100644 --- a/tests/Phpml/Math/ProductTest.php +++ b/tests/Phpml/Math/ProductTest.php @@ -1,5 +1,6 @@ assertEquals(10, Product::scalar([2, 3], [-1, 4])); $this->assertEquals(-0.1, Product::scalar([1, 4, 1], [-2, 0.5, -0.1])); $this->assertEquals(8, Product::scalar([2], [4])); } - -} \ No newline at end of file +}