php-ml/src/Phpml/Preprocessing/Imputer/Strategy/MostFrequentStrategy.php
2016-05-08 19:33:39 +02:00

22 lines
400 B
PHP

<?php
declare (strict_types = 1);
namespace Phpml\Preprocessing\Imputer\Strategy;
use Phpml\Preprocessing\Imputer\Strategy;
use Phpml\Math\Statistic\Mean;
class MostFrequentStrategy implements Strategy
{
/**
* @param array $currentAxis
*
* @return float|mixed
*/
public function replaceValue(array $currentAxis)
{
return Mean::mode($currentAxis);
}
}