MCordingley\Regression\StatisticsGatherer\Linear::getSumSquaredError PHP Метод

getSumSquaredError() приватный Метод

Calculates the sum of the squares of the residuals, which are the distances of the observations from their predicted values, a raw measure of the overall error in the regression model.
private getSumSquaredError ( ) : float
Результат float
    private function getSumSquaredError() : float
    {
        if (is_null($this->sumSquaredError)) {
            $this->sumSquaredError = array_sum(array_map(function ($predicted, $observed) {
                return pow($predicted - $observed, 2);
            }, $this->getPredictedOutcomes(), $this->observations->getOutcomes()));
        }
        return $this->sumSquaredError;
    }