def information_gain(data, column, cut_point):
    """
    For calculating the goodness of a split. The difference of the entropy of parent and 
    the weighted entropy of children.
    :params:attribute_index, labels of the node t as `labels` and cut point as `cut_point`
    :returns: The net entropy of partition 
    """
subset1, subset2 = divide_data(data, column, cut_point)
lensub1, lensub2 = len(subset1), len(subset2)
if len(subset1) == 0 or len(subset2) == 0:
    return 0, subset1, subset2
Calculating the entropy of an attribute in the ID3 algorithm when a split is perfectly classified