I am trying to integrate PHPML with an existing project. PHPML uses namespaces and I have little experience using them.
I am able to run PHPML directly through my controller however when integrating it in to a class method I get the following error
Parse error: syntax error, unexpected 'use' (T_USE) in... on line 4
My class method:
class learn{
public function return_adjustments(){
include 'application/vendor/autoload.php';
use Phpml\Regression\LeastSquares;
use Phpml\Exception\FileException;
$samples = $this->csv_to_array('samples.csv');
$targets = $this->csv_to_array('targets.csv');
$regression = new LeastSquares();
$regression->train($samples, $targets);
}
Is it possible to do this correctly? I'm struggling on the concept of namespaces.