mirror of
https://github.com/Llewellynvdm/php-ml.git
synced 2024-11-29 00:06:31 +00:00
8a0a9f09e2
Method has already changed name to getTargets() instead of getLabels()
22 lines
455 B
Markdown
22 lines
455 B
Markdown
# ArrayDataset
|
|
|
|
Helper class that holds data as PHP `array` type. Implements the `Dataset` interface which is used heavily in other classes.
|
|
|
|
### Constructors Parameters
|
|
|
|
* $samples - (array) of samples
|
|
* $labels - (array) of labels
|
|
|
|
```
|
|
$dataset = new ArrayDataset([[1, 1], [2, 1], [3, 2], [4, 1]], ['a', 'a', 'b', 'b']);
|
|
```
|
|
|
|
### Samples and labels
|
|
|
|
To get samples or labels you can use getters:
|
|
|
|
```
|
|
$dataset->getSamples();
|
|
$dataset->getTargets();
|
|
```
|