Conditions | 4 |
Paths | 1 |
Total Lines | 12 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
69 | public function transform(array &$samples, ?array &$targets = null): void |
||
70 | { |
||
71 | array_walk($samples, function (array &$sample): void { |
||
72 | foreach ($sample as $index => &$feature) { |
||
73 | if ($this->termCounts[$index] < $this->minTf || $this->idf[$index] < $this->minIdf) { |
||
74 | unset($sample[$index]); |
||
75 | |||
76 | continue; |
||
77 | } |
||
78 | $feature *= $this->idf[$index]; |
||
79 | } |
||
80 | $sample = array_values($sample); |
||
81 | }); |
||
84 |