public static function score(array $actualLabels, array $predictedLabels, bool $normalize = true)
{
if (count($actualLabels) != count($predictedLabels)) {
throw InvalidArgumentException::arraySizeNotMatch();
}
$score = 0;
foreach ($actualLabels as $index => $label) {
if ($label == $predictedLabels[$index]) {
++$score;
}
}
if ($normalize) {
$score = $score / count($actualLabels);
}
return $score;
}