用法:
class mxnet.metric.PCC(name='pcc', output_names=None, label_names=None, has_global_stats=True)
- name:(
str
) - 此度量實例的名稱用於顯示。 - output_names:(
list of str
, or
None
) - 使用update_dict 更新時應使用的預測名稱。默認情況下包括所有預測。 - label_names:(
list of str
, or
None
) - 使用update_dict 更新時應使用的標簽名稱。默認情況下包括所有標簽。
- name:(
參數:
PCC 是從 Pearson 相關係數的離散解派生的 Matthews 相關係數的多類等價物。
根據 K x K 混淆矩陣 C 定義。
當標簽超過兩個時,PCC 將不再介於 -1 和 +1 之間。相反,最小值將在 -1 和 0 之間,具體取決於真實分布。最大值始終為 +1。
例子:
>>> # In this example the network almost always predicts positive >>> false_positives = 1000 >>> false_negatives = 1 >>> true_positives = 10000 >>> true_negatives = 1 >>> predicts = [mx.nd.array( [[.3, .7]]*false_positives + [[.7, .3]]*true_negatives + [[.7, .3]]*false_negatives + [[.3, .7]]*true_positives )] >>> labels = [mx.nd.array( [0]*(false_positives + true_negatives) + [1]*(false_negatives + true_positives) )] >>> f1 = mx.metric.F1() >>> f1.update(preds = predicts, labels = labels) >>> pcc = mx.metric.PCC() >>> pcc.update(preds = predicts, labels = labels) >>> print f1.get() ('f1', 0.95233560306652054) >>> print pcc.get() ('pcc', 0.01917751877733392)
相關用法
- Python mxnet.metric.Perplexity用法及代碼示例
- Python mxnet.metric.PearsonCorrelation用法及代碼示例
- Python mxnet.metric.F1用法及代碼示例
- Python mxnet.metric.TopKAccuracy用法及代碼示例
- Python mxnet.metric.CompositeEvalMetric用法及代碼示例
- Python mxnet.metric.create用法及代碼示例
- Python mxnet.metric.RMSE用法及代碼示例
- Python mxnet.metric.MAE用法及代碼示例
- Python mxnet.metric.MCC用法及代碼示例
- Python mxnet.metric.MSE用法及代碼示例
- Python mxnet.metric.CrossEntropy用法及代碼示例
- Python mxnet.metric.CustomMetric用法及代碼示例
- Python mxnet.metric.np用法及代碼示例
- Python mxnet.metric.Accuracy用法及代碼示例
- Python mxnet.metric.NegativeLogLikelihood用法及代碼示例
- Python mxnet.module.BaseModule.get_outputs用法及代碼示例
- Python mxnet.module.BaseModule.forward用法及代碼示例
- Python mxnet.module.BaseModule.bind用法及代碼示例
- Python mxnet.module.BaseModule.init_params用法及代碼示例
- Python mxnet.module.BaseModule.get_params用法及代碼示例
- Python mxnet.module.BaseModule.set_params用法及代碼示例
- Python mxnet.module.BaseModule.update用法及代碼示例
- Python mxnet.module.SequentialModule.add用法及代碼示例
- Python mxnet.module.BaseModule.iter_predict用法及代碼示例
- Python mxnet.module.BaseModule.save_params用法及代碼示例
注:本文由純淨天空篩選整理自apache.org大神的英文原創作品 mxnet.metric.PCC。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。