mirror of
https://github.com/Llewellynvdm/php-ml.git
synced 2024-06-12 21:32:22 +00:00
22 lines
400 B
PHP
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);
|
|
}
|
|
}
|