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;
    }