MonoLayer Perceptron
All checks were successful
linter / quality (push) Successful in 6m16s
tests / ci (8.4) (push) Successful in 4m10s
tests / ci (8.5) (push) Successful in 4m29s

This commit is contained in:
2026-04-04 16:45:04 +02:00
parent f6620c2eca
commit 2f4db07918
21 changed files with 641 additions and 226 deletions

View File

@@ -55,6 +55,19 @@ class RandomOrderDataSetReader implements IDataSetReader
return count($this->lines[0]) - 1; // Don't count the label
}
public function getOutputSize(): int
{
// Count the number of unique labels in the dataset
$labels = array_map(fn ($line) => end($line), $this->lines);
return count(array_unique($labels));
}
public function getLabels(): array
{
$labels = array_map(fn ($line) => end($line), $this->lines);
return array_values(array_unique($labels));
}
public function reset(): void
{
$this->currentLines = $this->lines;