mirror of
https://github.com/Llewellynvdm/php-ml.git
synced 2024-11-11 08:10:56 +00:00
Speed up DataTransformer (#122)
This commit is contained in:
parent
b1be0574d8
commit
03751f51ed
@ -57,7 +57,7 @@ class DataTransformer
|
|||||||
$numericLabels = self::numericLabels($labels);
|
$numericLabels = self::numericLabels($labels);
|
||||||
$results = [];
|
$results = [];
|
||||||
foreach (explode(PHP_EOL, $rawPredictions) as $result) {
|
foreach (explode(PHP_EOL, $rawPredictions) as $result) {
|
||||||
if (strlen($result) > 0) {
|
if (isset($result[0])) {
|
||||||
$results[] = array_search($result, $numericLabels);
|
$results[] = array_search($result, $numericLabels);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user