def intersection_over_union(y_true, y_pred):
    """
    Intersection over union

    Parameters
    ----------
    y_true: numpy.ndarray
        Ground truth
    y_pred: numpy.ndarray
        Prediction

    Returns
    -------
    iou_score: float
        Intersection over union score

    """
    intersection = y_true & y_pred
    union = y_true | y_pred
    return intersection.sum() / union.sum()
