php-ml/src/Helper/Trainable.php

25 lines
406 B
PHP
Raw Normal View History

2016-04-16 19:24:40 +00:00
<?php
2016-04-16 19:41:37 +00:00
2016-11-20 21:53:17 +00:00
declare(strict_types=1);
2016-04-16 19:24:40 +00:00
2016-05-07 21:04:58 +00:00
namespace Phpml\Helper;
2016-04-16 19:24:40 +00:00
trait Trainable
{
/**
* @var array
*/
private $samples = [];
2016-04-16 19:24:40 +00:00
/**
* @var array
*/
private $targets = [];
2016-04-16 19:24:40 +00:00
public function train(array $samples, array $targets): void
2016-04-16 19:24:40 +00:00
{
$this->samples = array_merge($this->samples, $samples);
$this->targets = array_merge($this->targets, $targets);
2016-04-16 19:24:40 +00:00
}
}