src/Supervised/Classification/KNearestNeighbors.php
public function distance(array $a, array $b): float
    {
        if (count($a) !== count($b)) {
            throw InvalidArgumentException::arraySizeNotMatch();
        }
        $distance = 0;
        $count = count($a);
        for ($i = 0; $i < $count; ++$i) {
            $distance += pow($a[$i] - $b[$i], 2);
        }
        return sqrt((float) $distance);
    }
public function distance(array $a, array $b): float
    {
        if (count($a) !== count($b)) {
            throw InvalidArgumentException::arraySizeNotMatch();
        }
        $distance = 0;
        $count = count($a);
        for ($i = 0; $i < $count; ++$i) {
            $distance += pow($a[$i] - $b[$i], 2);
        }
        return sqrt((float) $distance);
    }
@param array $a
@param array $b

@return float

@throws InvalidArgumentException