outcome = $outcome; $this->impurity = $impurity; $this->n = $n; } /** * Return the outcome of the decision i.e the average of the labels. * * @return int|float */ public function outcome() { return $this->outcome; } /** * Return the impurity within the node. * * @return float */ public function impurity() : float { return $this->impurity; } /** * Return the number of labels within the node. * * @return int */ public function n() : int { return $this->n; } /** * Return the height of the node in the tree. * * @return int */ public function height() : int { return 1; } /** * Return the string representation of the object. * * @internal * * @return string */ public function __toString() : string { return "Average {outcome: {$this->outcome}, impurity: {$this->impurity}, n: {$this->n}}"; } }