outcome = $outcome; $this->probabilities = $probabilities; $this->impurity = $impurity; $this->n = $n; } /** * Return the outcome of the decision. * * @return string */ public function outcome() : string { return $this->outcome; } /** * Return the probabilities of each possible outcome. * * @return float[] */ public function probabilities() : array { return $this->probabilities; } /** * 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 "Best {outcome: {$this->outcome}, impurity: {$this->impurity}, n: {$this->n}}"; } }