mirror of
https://github.com/Llewellynvdm/php-ml.git
synced 2024-11-05 04:57:52 +00:00
force implementation of protected functon in Predictable trait
This commit is contained in:
parent
b04cf220bd
commit
d9d7895947
@ -44,7 +44,7 @@ class KNearestNeighbors implements Classifier
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
private function predictSample(array $sample)
|
||||
protected function predictSample(array $sample)
|
||||
{
|
||||
$distances = $this->kNeighborsDistances($sample);
|
||||
|
||||
|
@ -16,7 +16,7 @@ class NaiveBayes implements Classifier
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
private function predictSample(array $sample)
|
||||
protected function predictSample(array $sample)
|
||||
{
|
||||
$predictions = [];
|
||||
foreach ($this->labels as $index => $label) {
|
||||
|
@ -24,4 +24,11 @@ trait Predictable
|
||||
|
||||
return $predicted;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $sample
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
abstract protected function predictSample(array $sample);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user