|
@@ 90-93 (lines=4) @@
|
| 87 |
|
{ |
| 88 |
|
$impurity = $this->impurity; |
| 89 |
|
|
| 90 |
|
if ($this->left() instanceof PurityNode) { |
| 91 |
|
$impurity -= $this->left()->impurity() |
| 92 |
|
* ($this->left()->samplesCount() / $this->samplesCount); |
| 93 |
|
} |
| 94 |
|
|
| 95 |
|
if ($this->right() instanceof PurityNode) { |
| 96 |
|
$impurity -= $this->right()->impurity() |
|
@@ 95-98 (lines=4) @@
|
| 92 |
|
* ($this->left()->samplesCount() / $this->samplesCount); |
| 93 |
|
} |
| 94 |
|
|
| 95 |
|
if ($this->right() instanceof PurityNode) { |
| 96 |
|
$impurity -= $this->right()->impurity() |
| 97 |
|
* ($this->right()->samplesCount() / $this->samplesCount); |
| 98 |
|
} |
| 99 |
|
|
| 100 |
|
return $impurity; |
| 101 |
|
} |