public static function split(Dataset $dataset, Distance $kernel) : self
    {
        $samples = $dataset->samples();

        $center = Matrix::quick($samples)
            ->transpose()
            ->mean()
            ->asArray();
            
        $distances = [];

        foreach ($samples as $sample) {
            $distances[] = $kernel->compute($sample, $center);
        }

        $radius = max($distances);

        $leftCentroid = $dataset->row(argmax($distances));

        $distances = [];

        foreach ($samples as $sample) {
            $distances[] = $kernel->compute($sample, $leftCentroid);
        }

        $rightCentroid = $dataset->row(argmax($distances));
        
        $subsets = $dataset->spatialPartition($leftCentroid, $rightCentroid, $kernel);

        return new self($center, $radius, $subsets);
    }