峰值性能怎么算_预测指标

峰值性能怎么算_预测指标对峰值预测性能的评价指标一、指标解释二、计算设计三、代码如下四、小结一、指标解释我在研究论文的时候观察到了一个性能指标,叫做PPTS(Peakpercentageofthresholdstatistic),翻译过来是

一、指标解释

我在研究论文的时候观察到了一个性能指标,叫做PPTS(Peak percentage of threshold statistic),翻译过来是:阈值统计的峰值百分比。这篇论文中给出的定义为:
computes the average absolute relative error of predictands of the top γ% streamflow data.The lower the PPTS,the better the capability to forecast peak flow. Note that the recorded streamflow values are arranged in descending order to compute the PPTS and that the threshold level γ denotes the percentage of data selected from the beginning of the arranged data sequence. The parameter G is the number of values above the threshold level γ.
计算公式为:
可以看到,这个公式与平均相对误差非常相似
可以从公式看到,这个PPTS其实就是 一个 平均绝对百分比误差(Mean Absolute Percentage Error,MAPE),但是是将原来的流量序列进行一个降序排列,选择top γ%的数据进行MAPE的计算。

二、计算设计

我利用这个概念自己设计了一个PPTS的计算

  1. 得到y_true(原始流量)的最大值y_max,与最小值y_min。
  2. 设置delta=y_max-y_min。
  3. 设置一个百分比γ,设阈值为Gamma,Gamma=y_min+p*delta
  4. 利用eff=np.where(y_true>Gamma)得到满足y_true>Gamma的元素所在的矩阵位置。
  5. 对满足条件的流量值计算相对误差的绝对值。
  6. 最后求取平均值即可

三、代码如下

// An highlighted block
def PPTS(y_true, y_pred):
    """
    参数:
    y_true -- 测试集目标真实值
    y_pred -- 测试集目标预测值

    返回:
    mape -- MAPE 评价指标
    """
    p=0.01
    y_max=np.max(y_true)
    y_min=np.min(y_true)
    delta=y_max-y_min
    Gamma = y_min+p*delta
    mape=0
    label= np.where(y_true > Gamma)
    eff=label[0]
    l=len(eff)
    for i,a in enumerate(eff):
        mape = mape+(np.abs((y_true[a,:] - y_pred[a,:]) / y_true[a,:]) * 100)

    ppts = mape/ l
    return ppts

四、小结

自己设计的这个指标与论文中的PPTS还是有一些不同的,它其实是计算了top(1-γ)的MAPE,不过同样能评估模型对峰值的计算性能了。

今天的文章峰值性能怎么算_预测指标分享到此就结束了,感谢您的阅读。

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
如需转载请保留出处:https://bianchenghao.cn/85637.html

(0)
编程小号编程小号

相关推荐

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注