public function purityIncrease() : float
    {
        $impurity = $this->impurity;

        if ($this->left instanceof Purity) {
            $impurity -= $this->left->impurity()
                * ($this->left->n() / $this->n);
        }

        if ($this->right instanceof Purity) {
            $impurity -= $this->right->impurity()
                * ($this->right->n() / $this->n);
        }

        return $impurity;
    }
public function purityIncrease() : float
    {
        $impurity = $this->impurity;

        if ($this->left instanceof Purity) {
            $impurity -= $this->left->impurity()
                * ($this->left->n() / $this->n);
        }

        if ($this->right instanceof Purity) {
            $impurity -= $this->right->impurity()
                * ($this->right->n() / $this->n);
        }

        return $impurity;
    }
public function purityIncrease ( ) : float { $ impurity = $ this -> impurity ; if ( $ this -> left instanceof Purity ) { $ impurity -= $ this -> left -> impurity ( ) * ( $ this -> left -> n ( ) / $ this -> n ) ; } if ( $ this -> right instanceof Purity ) { $ impurity -= $ this -> right -> impurity ( ) * ( $ this -> right -> n ( ) / $ this -> n ) ; } return $ impurity ; }
Return the decrease in impurity this decision node introduces.

@return float
Return the decrease in impurity this decision node introduces .