make_scorer(来自sklearn.metrics)用于多类对数损失

时间:2016-04-06 14:10:36

标签: python scoring

我得到了以下代码的均方根误差L

from sklearn.metrics import make_scorer

def rmsele(actual, pred):
    squared_errors = (np.log(pred + 1) - np.log(actual + 1)) ** 2
    mean_squared = np.sum(squared_errors) / len(squared_errors)
    return np.sqrt(mean_squared)

rmsele_scorer = make_scorer(rmsele, greater_is_better=False)

我希望有一个用于多级对数损失。有人可以帮忙吗?

0 个答案:

没有答案