2017-03-01 09:16:15 +00:00
|
|
|
<?php
|
2017-02-28 20:45:18 +00:00
|
|
|
|
2017-03-01 09:16:15 +00:00
|
|
|
declare(strict_types=1);
|
2017-02-28 20:45:18 +00:00
|
|
|
|
2017-03-01 09:16:15 +00:00
|
|
|
namespace Phpml\Classification;
|
2017-02-28 20:45:18 +00:00
|
|
|
|
|
|
|
abstract class WeightedClassifier implements Classifier
|
|
|
|
{
|
2017-03-05 15:25:01 +00:00
|
|
|
/**
|
|
|
|
* @var array
|
|
|
|
*/
|
2017-11-22 21:16:10 +00:00
|
|
|
protected $weights = [];
|
2017-02-28 20:45:18 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the array including a weight for each sample
|
|
|
|
*/
|
2017-11-14 20:21:23 +00:00
|
|
|
public function setSampleWeights(array $weights): void
|
2017-02-28 20:45:18 +00:00
|
|
|
{
|
|
|
|
$this->weights = $weights;
|
|
|
|
}
|
|
|
|
}
|