相同算法请见建模之常见损失函数
序号 | 概况 | 表达式 | 场景 | keras | sklearn | R |
---|---|---|---|---|---|---|
1 | 分类准确率 | 预测正确个数的占比 | 分类 | keras.metrics.Accuracy accuracy |
sklearn.metrics.accuracy_score | Accuracy |
2 | 二分类准确率 | 同上 | 分类 | keras.metrics.BinaryAccuracy keras.metrics.binary_accuracy binary_accuracy |
||
3 | 多分类准确率 | 同上 | 分类 | keras.metrics.CategoricalAccuracy categorical_accuracy |
||
4 | 目标在前K个预测中的频率 | keras.metrics.TopKCategoricalAccuracy top_k_categorical_accuracy |
||||
5 | 整数目标在前K个预测中的频率 | keras.metrics.SparseTopKCategoricalAccuracy sparse_top_k_categorical_accuracy |
||||
6 | 交叉熵 | 同损失函数 | keras.metrics.BinaryCrossentropy binary_crossentropy |
同损失函数 | ||
7 | 交叉熵 | 同损失函数 | keras.metrics.CategoricalCrossentropy categorical_crossentropy |
同损失函数 | ||
8 | 交叉熵 | 同损失函数 | keras.metrics.SparseCategoricalCrossentropy sparse_categorical_crossentropy |
同损失函数 | ||
9 | KL散度 | 同损失函数 | keras.metrics.KLDivergence kullback_leibler_divergence |
同损失函数 | ||
10 | poisson | 同损失函数 | keras.metrics.Poisson poisson |
同损失函数 | ||
11 | mse | 同损失函数 | 回归 | keras.metrics.MeanSquaredError mean_squared_error |
同损失函数 | |
12 | rmse | 同损失函数 | 回归 | keras.metrics.RootMeanSquaredError root_mean_squared_error |
同损失函数 | |
13 | mae | 同损失函数 | 回归 | keras.metrics.MeanAbsoluteError mean_absolute_error |
同损失函数 | |
14 | mape | 同损失函数 | 回归/时序 | keras.metrics.MeanAbsolutePercentageError mean_absolute_percentage_error |
同损失函数 | |
15 | msle | 同损失函数 | 回归 | keras.metrics.MeanSquaredLogarithmicError mean_squared_logarithmic_error |
同损失函数 | |
16 | 余弦相似度 | 同损失函数 | keras.metrics.CosineSimilarity cosine_similarity |
同损失函数 | ||
17 | 同损失函数 | keras.metrics.LogCoshError logcosh |
同损失函数 | |||
18 | AUC | ∑ ( I ( p p o s , p n e g ) ) p o s × n e g \frac{\sum(I(p_{pos}, p_{neg}))}{pos \times neg} pos×neg∑(I(ppos,pneg)) i f p p o s > p n e g : I ( p p o s , p n e g ) = 1 if\ p_{pos} \gt p_{neg}: I(p_{pos}, p_{neg}) = 1 if ppos>pneg:I(p |