【算法检验】StepM和MCS

本文介绍了两种用于评估预测模型优劣的统计检验方法:SPA(Superior Predictive Ability)和MCS(Model Confidence Set)。SPA能够判断一个模型是否比基准模型更优秀,而MCS则能找出一组在统计意义上没有显著差异的最优模型集合。
部署运行你感兴趣的模型镜像

继上节SPA继续介绍StepM和MCS检验

【算法检验】SPA_Checkmate9949的博客-优快云博客一、概念The multiple comparison procedures all allow for examining aspects of superior predictive ability.用于检验更优的预测能力There are three available:SPA - The test of Superior Predictive Ability, also known as the Reality Check (and accessible as RealityChechttps://blog.youkuaiyun.com/Checkmate9949/article/details/120370004

一、StepM检验

1、概念

SM类似于SPA,都具有同样的零假设。主要不同:SM可以识别比基准模型好的一系列模型,而不是只是验证某个模型更好。

Stepwise Multiple Testing is similar to the SPA and has the same null. The primary difference is that it identifies the set of models which are better than the benchmark, rather than just asking the basic question if any model is better.

2、例子

from arch.bootstrap import StepM

stepm = StepM(bm_losses, model_losses)
stepm.compute()
#识别出优于基准模型的模型
print("Model indices:")
print([model.split(".")[1] for model in stepm.superior_models])



#求各模型的平均Loss
test2 = model_losses.mean(0)
better_models = pd.concat([model_losses.mean(0), model_losses.mean(0)],axis=1)
better_models.columns = ["Same or worse", "Better"]
#得出better模型的index
better = better_models.index.isin(stepm.superior_models)
#得出worse模型的index
worse = np.logical_not(better)
#写为正确的值
better_models.loc[better, "Same or worse"] = np.nan
better_models.loc[worse, "Better"] = np.nan
#画图:绿色为更优的模型
fig = better_models.plot(style=["o", "s"], rot=270)

 二、MCS检验

1、概念

The Model Confidence Set

MCS将一系列Loss作为输入,以发现类似的算法集。其主要输出为P值,其模型的P值高于Size。较小的P值代表模型能够被其他更好的模型拒绝。

The model confidence set takes a set of losses as its input and finds the set which are not statistically different from each other while controlling the familywise error rate. The primary output is a set of p-values, where models with a pvalue above the size are in the MCS. Small p-values indicate that the model is easily rejected from the set that includes the best.

2、例子

from arch.bootstrap import MCS

# 取出25个算法,500/20=25
losses = model_losses.iloc[:, ::20]
mcs = MCS(losses, size=0.10)
mcs.compute()
# 显示各模型的MSC P值
print("MCS P-values")
print(mcs.pvalues)
# Included: P>0.1
print("Included")
included = mcs.included
print([model.split(".")[1] for model in included])
# Excluded: P<=0.1
print("Excluded")
excluded = mcs.excluded
print([model.split(".")[1] for model in excluded])

Included为更优秀的算法集,P越大,算法越好。 

您可能感兴趣的与本文相关的镜像

ACE-Step

ACE-Step

音乐合成
ACE-Step

ACE-Step是由中国团队阶跃星辰(StepFun)与ACE Studio联手打造的开源音乐生成模型。 它拥有3.5B参数量,支持快速高质量生成、强可控性和易于拓展的特点。 最厉害的是,它可以生成多种语言的歌曲,包括但不限于中文、英文、日文等19种语言

评论 8
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值