Skip to content

Commit

Permalink
Update SVC.php (#345)
Browse files Browse the repository at this point in the history
  • Loading branch information
LouisAUTHIE authored Aug 30, 2024
1 parent fef1033 commit 65251d9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Classifiers/SVC.php
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,12 @@ public function predictSample(array $sample) : string
throw new RuntimeException('Estimator has not been trained.');
}

$index = $this->model->predict($sample);
$sampleWithOffset = [];
foreach($sample as $key=>$value){
$sampleWithOffset[$key+1] = $value;
}

$index = $this->model->predict($sampleWithOffset);

return $this->classes[$index];
}
Expand Down

0 comments on commit 65251d9

Please sign in to comment.