Skip to content

Commit

Permalink
Update OneClassSVM.php
Browse files Browse the repository at this point in the history
  • Loading branch information
LouisAUTHIE authored Oct 30, 2024
1 parent c3897a3 commit 011b52f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/AnomalyDetectors/OneClassSVM.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,10 @@ public function train(Dataset $dataset) : void

$data = [];

foreach ($dataset->samples() as $i => $sample) {
$data[] = array_merge([1], $sample);
foreach ($dataset->samples() as $sample) {
$sample_array = $sample;
array_unshift($sample_array, 1);
$data[] = $sample_array;
}

$this->model = $this->svm->train($data);
Expand Down

0 comments on commit 011b52f

Please sign in to comment.