/**
* @param Observation $observation
* @return 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;
}