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 = [];
    }
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 = [];
    }
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 = [ ] ; }
Train the regression tree by learning the optimal splits in the
training set.

@param \Rubix\ML\Datasets\Dataset $dataset
@throws \InvalidArgumentException
Train the regression tree by learning the optimal splits in the training set .