compatibility(); } $compatibility = array_intersect(...$compatibilities); if (count($compatibility) < 1) { throw new InvalidArgumentException('Report must contain' . ' sub reports that have at least 1 compatible' . ' Estimator type in common.'); } $this->reports = $reports; $this->compatibility = array_values($compatibility); } /** * The estimator types that this report is compatible with. * * @internal * * @return list<\Rubix\ML\EstimatorType> */ public function compatibility() : array { return $this->compatibility; } /** * Generate the report. * * @param list $predictions * @param list $labels * @return Report */ public function generate(array $predictions, array $labels) : Report { $reports = []; foreach ($this->reports as $name => $report) { $reports[$name] = $report->generate($predictions, $labels); } return new Report($reports); } }