def calc_csi(precision, recall):
    """
    Compute the critical success index
    """
    precision[precision<1e-5] = 1e-3
    recall[recall<1e-5] = 1e-3
    
    csi = 1.0 / ((1/precision) + (1/recall) - 1.0)
    
    return csi