public function predict(Dataset $dataset) : array
    {
        if (!$this->weights or $this->bias === null) {
            throw new RuntimeException('Estimator has not been trained.');
        }

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

        return Matrix::build($dataset->samples())
            ->dot($this->weights)
            ->add($this->bias)
            ->asArray();
    }
public function predict(Dataset $dataset) : array
    {
        if (!$this->weights or $this->bias === null) {
            throw new RuntimeException('Estimator has not been trained.');
        }

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

        return Matrix::build($dataset->samples())
            ->dot($this->weights)
            ->add($this->bias)
            ->asArray();
    }
public function predict ( Dataset $ dataset ) : array { if ( ! $ this -> weights or $ this -> bias === null ) { throw new RuntimeException ( 'Estimator has not been trained.' ) ; } DatasetIsCompatibleWithEstimator :: check ( $ dataset , $ this ) ; return Matrix :: build ( $ dataset -> samples ( ) ) -> dot ( $ this -> weights ) -> add ( $ this -> bias ) -> asArray ( ) ; }
Make a prediction based on the line calculated from the training data.

@param \Rubix\ML\Datasets\Dataset $dataset
@throws \InvalidArgumentException
@throws \RuntimeException
@return array
Make a prediction based on the line calculated from the training data .