force implementation of protected functon in Predictable trait

This commit is contained in:
Arkadiusz Kondas 2016-04-19 22:54:15 +02:00
parent b04cf220bd
commit d9d7895947
3 changed files with 9 additions and 2 deletions

View File

@ -44,7 +44,7 @@ class KNearestNeighbors implements Classifier
* *
* @return mixed * @return mixed
*/ */
private function predictSample(array $sample) protected function predictSample(array $sample)
{ {
$distances = $this->kNeighborsDistances($sample); $distances = $this->kNeighborsDistances($sample);

View File

@ -16,7 +16,7 @@ class NaiveBayes implements Classifier
* *
* @return mixed * @return mixed
*/ */
private function predictSample(array $sample) protected function predictSample(array $sample)
{ {
$predictions = []; $predictions = [];
foreach ($this->labels as $index => $label) { foreach ($this->labels as $index => $label) {

View File

@ -24,4 +24,11 @@ trait Predictable
return $predicted; return $predicted;
} }
/**
* @param array $sample
*
* @return mixed
*/
abstract protected function predictSample(array $sample);
} }