public function testEvaluate() { $algorithm = new BasicChiSquareAlgorithm($this->ETreeRules, $this->Xpath); $algorithm->evaluate(); $expected = ['Age_in_years' => 1, 'Repayment' => 0.2, 'Amount' => 0.12, 'Age' => 0.1, 'Duration' => 0.1]; $this->assertEquals($expected, $algorithm->getAttributes()); }
public function parseData() { $array['recommendedAttributes'] = array(); if ($this->ETreeXPath->evaluate('count(//guha:ETreeModel)')) { $algorithm = new BasicChiSquareAlgorithm($this->ETreeXPath->evaluate('//guha:ETreeModel/ETreeRules')->item(0), $this->ETreeXPath); $algorithm->evaluate(); $array['recommendedAttributes'] = $algorithm->getAttributes(); } return $array; }