src/PHPSci/NaiveBayes/BaseNaiveBayes.php
public function predict(\CArray $X)
    {
        $predicted_classes = [];
        $jll = $this->_joint_log_likelihood($X);
        $predictions = CArray::toArray(CArray::argmax($jll, 1));
        foreach($predictions as $pred) {
            $predicted_classes[] = $this->classes_[[(int)$pred]];
        }
        return $predicted_classes;
    }
public function predict(\CArray $X)
    {
        $predicted_classes = [];
        $jll = $this->_joint_log_likelihood($X);
        $predictions = CArray::toArray(CArray::argmax($jll, 1));
        foreach($predictions as $pred) {
            $predicted_classes[] = $this->classes_[[(int)$pred]];
        }
        return $predicted_classes;
    }
public function predict ( \ CArray $ X ) { $ predicted_classes = [ ] ; $ jll = $ this -> _joint_log_likelihood ( $ X ) ; $ predictions = CArray :: toArray ( CArray :: argmax ( $ jll , 1 ) ) ; foreach ( $ predictions as $ pred ) { $ predicted_classes [ ] = $ this -> classes_ [ [ ( int ) $ pred ] ] ; } return $ predicted_classes ; }
Perform classification on an array of test vectors X.
@param \CArray $X
@return void
Perform classification on an array of test vectors X .