0
假設我們要更改Abalone regression example,以便有額外的評估指標。該指標,叫做pctWrong
,等於預測的,其誤差爲> 1%的百分比: === pseudocode === pctWrong = countTrue(if (|y-y_hat|/y > 1%) True else False)/countTotal
Tensorflow:自定義錯誤聚合器
=== Python ===
105 # Calculate additional eval metrics
106 eval_metric_ops = {
107 "rmse": tf.metrics.root_mean_squared_error(
108 tf.cast(labels, tf.float64), predictions),
109 "pctWrong": ???
110 }
你會如何定義這樣的指標?我發現tf.metrics.percentage_below(),這可能會有幫助,但我不知道如何使用它。特別是我不知道如何獲得它的values
參數。