Skip to content

Commit

Permalink
Speed up DataTransformer (#122)
Browse files Browse the repository at this point in the history
  • Loading branch information
marmichalski authored and akondas committed Sep 2, 2017
1 parent b1be057 commit 03751f5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Phpml/SupportVectorMachine/DataTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public static function predictions(string $rawPredictions, array $labels): array
$numericLabels = self::numericLabels($labels);
$results = [];
foreach (explode(PHP_EOL, $rawPredictions) as $result) {
if (strlen($result) > 0) {
if (isset($result[0])) {
$results[] = array_search($result, $numericLabels);
}
}
Expand Down

0 comments on commit 03751f5

Please sign in to comment.