mirror of
https://github.com/Llewellynvdm/php-ml.git
synced 2025-02-09 15:38:33 +00:00
29 lines
480 B
PHP
29 lines
480 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Phpml\Helper;
|
|
|
|
trait Trainable
|
|
{
|
|
/**
|
|
* @var array
|
|
*/
|
|
private $samples = [];
|
|
|
|
/**
|
|
* @var array
|
|
*/
|
|
private $targets = [];
|
|
|
|
/**
|
|
* @param array $samples
|
|
* @param array $targets
|
|
*/
|
|
public function train(array $samples, array $targets): void
|
|
{
|
|
$this->samples = array_merge($this->samples, $samples);
|
|
$this->targets = array_merge($this->targets, $targets);
|
|
}
|
|
}
|