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

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

public addObservation ( Observation $observation ) : self
$observation Observation
Результат self
    public function addObservation(Observation $observation) : self
    {
        $featureCount = count($observation->getFeatures());
        if (!$this->featureCount) {
            $this->featureCount = $featureCount;
        } elseif ($this->featureCount !== $featureCount) {
            throw new InvalidArgumentException('All observations must have the same number of features.');
        }
        $this->observations[] = $observation;
        return $this;
    }