MonoLayer Perceptron
This commit is contained in:
@@ -49,6 +49,19 @@ class LinearOrderDataSetReader 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;
|
||||
|
||||
Reference in New Issue
Block a user