Skip to content

Commit f369730

Browse files
committed
Backported Decision tree off-by-one fix
Pull Request #210 included a bug fix for a off-by-one bug found thanks to the visualzation (see #210 (comment) for details).
1 parent dfabe19 commit f369730

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Graph/Trees/DecisionTree.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ public function search(array $sample) : ?Outcome
226226
$current = $current->right();
227227
}
228228
} else {
229-
if ($sample[$current->column()] < $value) {
229+
if ($sample[$current->column()] <= $value) {
230230
$current = $current->left();
231231
} else {
232232
$current = $current->right();

0 commit comments

Comments
 (0)