public function predict(Dataset $dataset) : array
    {
        if (empty($this->ensemble)) {
            throw new RuntimeException('Estimator has not been trained.');
        }

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

        $predictions = $this->base->predict($dataset);

        foreach ($this->ensemble as $estimator) {
            foreach ($estimator->predict($dataset) as $j => $prediction) {
                $predictions[$j] += $this->rate * $prediction;
            }
        }

        return $predictions;
    }
public function predict(Dataset $dataset) : array
    {
        if (empty($this->ensemble)) {
            throw new RuntimeException('Estimator has not been trained.');
        }

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

        $predictions = $this->base->predict($dataset);

        foreach ($this->ensemble as $estimator) {
            foreach ($estimator->predict($dataset) as $j => $prediction) {
                $predictions[$j] += $this->rate * $prediction;
            }
        }

        return $predictions;
    }
public function predict ( Dataset $ dataset ) : array { if ( empty ( $ this -> ensemble ) ) { throw new RuntimeException ( 'Estimator has not been trained.' ) ; } DatasetIsCompatibleWithEstimator :: check ( $ dataset , $ this ) ; $ predictions = $ this -> base -> predict ( $ dataset ) ; foreach ( $ this -> ensemble as $ estimator ) { foreach ( $ estimator -> predict ( $ dataset ) as $ j => $ prediction ) { $ predictions [ $ j ] += $ this -> rate * $ prediction ; } } return $ predictions ; }
Make a prediction from a dataset.

@param \Rubix\ML\Datasets\Dataset $dataset
@throws \RuntimeException
@throws \InvalidArgumentException
@return array
Make a prediction from a dataset .