We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 65251d9 commit c1bede9Copy full SHA for c1bede9
src/Regressors/SVR.php
@@ -235,8 +235,12 @@ public function predictSample(array $sample)
235
if (!$this->model) {
236
throw new RuntimeException('Estimator has not been trained.');
237
}
238
-
239
- return $this->model->predict($sample);
+ //As SVM needs to have the same keys and order between training samples and those to predict we need to put an offset to the keys
+ $sampleWithOffset = [];
240
+ foreach($sample as $key=>$value){
241
+ $sampleWithOffset[$key+1] = $value;
242
+ }
243
+ return $this->model->predict($sampleWithOffset);
244
245
246
/**
0 commit comments