From a2aa27adbab71852c9c0ab9002aaabc39c436c28 Mon Sep 17 00:00:00 2001 From: Arkadiusz Kondas Date: Mon, 4 Jul 2016 22:22:22 +0200 Subject: [PATCH] fix problem in SVM with path on windows --- src/Phpml/SupportVectorMachine/SupportVectorMachine.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Phpml/SupportVectorMachine/SupportVectorMachine.php b/src/Phpml/SupportVectorMachine/SupportVectorMachine.php index 0453d4c..65b8ef6 100644 --- a/src/Phpml/SupportVectorMachine/SupportVectorMachine.php +++ b/src/Phpml/SupportVectorMachine/SupportVectorMachine.php @@ -211,7 +211,7 @@ class SupportVectorMachine */ private function buildTrainCommand(string $trainingSetFileName, string $modelFileName): string { - return sprintf('%ssvm-train%s -s %s -t %s -c %s -n %s -d %s%s -r %s -p %s -m %s -e %s -h %d -b %d \'%s\' \'%s\'', + return sprintf('%ssvm-train%s -s %s -t %s -c %s -n %s -d %s%s -r %s -p %s -m %s -e %s -h %d -b %d %s %s', $this->binPath, $this->getOSExtension(), $this->type, @@ -226,8 +226,8 @@ class SupportVectorMachine $this->tolerance, $this->shrinking, $this->probabilityEstimates, - $trainingSetFileName, - $modelFileName + escapeshellarg($trainingSetFileName), + escapeshellarg($modelFileName) ); } }