information_gain#

information_gain(impurity, impurity_left, impurity_right, weight_left, weight_right) → ndarray[source]#

Decrease of impurity of one or more splits.

Parameters:
  • impurity (float) – Impurity of the node.

  • impurity_left (float or numpy.ndarray of shape (n_candidates,)) – Impurity of the children of each split.

  • impurity_right (float or numpy.ndarray of shape (n_candidates,)) – Impurity of the children of each split.

  • weight_left (float or numpy.ndarray of shape (n_candidates,)) – Total weight of the children of each split.

  • weight_right (float or numpy.ndarray of shape (n_candidates,)) – Total weight of the children of each split.

Returns:

gains

Return type:

float or numpy.ndarray of shape (n_candidates,)