Phpml\SupportVectorMachine\DataTransformer::predictions PHP Method

predictions() public static method

public static predictions ( string $rawPredictions, array $labels ) : array
$rawPredictions string
$labels array
return array
    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) {
                $results[] = array_search($result, $numericLabels);
            }
        }
        return $results;
    }