MCordingley\Regression\Observations::getOutcomes PHP Метод

getOutcomes() публичный Метод

public getOutcomes ( ) : array
Результат array
    public function getOutcomes() : array
    {
        return array_map(function (Observation $observation) {
            return $observation->getOutcome();
        }, $this->observations);
    }

Usage Example

Пример #1
0
 /**
  * Calculates the sum-squared total of the regression. This is the sum
  * of the squared distances of observations from their average, a useful
  * measure to put the sum-squared error (SSE) and sum-squared model (SSM)
  * into context.
  *
  * @return float
  */
 private function getSumSquaredTotal() : float
 {
     if (is_null($this->sumSquaredTotal)) {
         $average = array_sum($this->observations->getOutcomes()) / count($this->observations->getOutcomes());
         $this->sumSquaredTotal = static::sumSquaredDifference($this->observations->getOutcomes(), $average);
     }
     return $this->sumSquaredTotal;
 }
All Usage Examples Of MCordingley\Regression\Observations::getOutcomes