public function train(Dataset $dataset) : void
    {
        if (!$dataset instanceof Labeled) {
            throw new InvalidArgumentException('This estimator requires a'
                . ' labeled training set.');
        }

        DatasetIsCompatibleWithEstimator::check($dataset, $this);

        $k = $dataset->numColumns();

        $this->columns = range(0, $dataset->numColumns() - 1);
        $this->maxFeatures = $this->maxFeatures ?? (int) round(sqrt($k));

        $this->grow($dataset);

        $this->columns = [];
    }