from math import log


def cal_ctr(loss, pred):
    return (loss + log(1-pred)) / (log(1-pred) - log(pred))


def log_loss(true_label, predict_label):
    return - true_label * log(predict_label) - (1 - true_label) * log(1 - predict_label)