predictions = $predictions; $this->labels = $labels; } /** * Perform a check of the specification and throw an exception if invalid. * * @throws \Rubix\ML\Exceptions\InvalidArgumentException */ public function check() : void { if (count($this->predictions) !== count($this->labels)) { throw new InvalidArgumentException( 'Number of predictions and labels must be equal ' . count($this->predictions) . ' predictions but ' . count($this->labels) . ' labels given.' ); } } }