| Conditions | 2 |
| Paths | 2 |
| Total Lines | 14 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 14 | 1 | public function normalizeDataset(Dataset $data, ValueInterface $coefficient) |
|
| 15 | { |
||
| 16 | 1 | $normalizedData = []; |
|
| 17 | 1 | foreach ($data as $row) { |
|
| 18 | 1 | $features = $row->getIndependentVariable(); |
|
| 19 | 1 | $features = $this->normalizeValue($features, $coefficient); |
|
| 20 | 1 | $normalizedData[] = [ |
|
| 21 | 1 | $features->getValue(), |
|
| 22 | 1 | $row->getDependentVariable()->getValue() |
|
| 23 | 1 | ]; |
|
| 24 | 1 | } |
|
| 25 | |||
| 26 | 1 | return new Dataset($normalizedData, $data->getHypothesis()); |
|
| 27 | } |
||
| 28 | |||
| 33 | } |