本文整理汇总了Python中vmaf.config.VmafConfig.tools_resource_path方法的典型用法代码示例。如果您正苦于以下问题:Python VmafConfig.tools_resource_path方法的具体用法?Python VmafConfig.tools_resource_path怎么用?Python VmafConfig.tools_resource_path使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vmaf.config.VmafConfig
的用法示例。
在下文中一共展示了VmafConfig.tools_resource_path方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: significanceHM
# 需要导入模块: from vmaf.config import VmafConfig [as 别名]
# 或者: from vmaf.config.VmafConfig import tools_resource_path [as 别名]
def significanceHM(A, B, AUCs):
# function [pHM,CI] = significanceHM(A,B,AUCs)
# % By Lukas Krasula
assert A.shape[0] == B.shape[0] == AUCs.shape[0]
# n_met = size(A,1);
n_met = A.shape[0]
# CorrA = corr(A','type','Kendall');
# CorrB = corr(B','type','Kendall');
CorrA = _cov_kendall(A)
CorrB = _cov_kendall(B)
# pHM = ones(n_met);
# CI = ones(n_met,1);
# for i=1:n_met-1
#
# [CI(i),SE1] = AUC_CI(size(A,2),size(B,2),AUCs(i));
#
# for j=i+1:n_met
# [CI(j),SE2] = AUC_CI(size(A,2),size(B,2),AUCs(j));
#
# load('Hanley_McNeil.mat');
#
# rA = (CorrA(i,j) + CorrB(i,j))/2;
# AA = (AUCs(i) + AUCs(j))/2;
#
# [~,rr] = min(abs(rA-rA_vec));
# [~,aa] = min(abs(AA-AA_vec));
# r = Table_HM(rr,aa);
#
# z = abs(AUCs(i) - AUCs(j)) / sqrt( SE1^2 + SE2^2 + 2*r*SE1*SE2 );
# pHM(i,j) = 1-normcdf(z);
# pHM(j,i) = pHM(i,j);
# end
# end
hm_filepath = VmafConfig.tools_resource_path('Hanley_McNeil.mat')
hm_dict = scipy.io.loadmat(hm_filepath)
pHM = np.ones([n_met, n_met])
Table_HM = hm_dict['Table_HM']
AA_vec = hm_dict['AA_vec']
rA_vec = hm_dict['rA_vec']
CI = np.ones(n_met)
for i in range(1, n_met):
CI1,SE1 = AUC_CI(A.shape[1], B.shape[1], AUCs[i-1])
CI[i-1] = CI1
for j in range(i+1, n_met+1):
CI2, SE2 = AUC_CI(A.shape[1], B.shape[1], AUCs[j-1])
CI[j-1] = CI2
rA = (CorrA[i-1,j-1] + CorrB[i-1,j-1]) / 2
AA = (AUCs[i-1] + AUCs[j-1]) / 2
rr, _ = index_and_value_of_min(abs(rA - rA_vec).ravel())
aa, _ = index_and_value_of_min(abs(AA - AA_vec).ravel())
r = Table_HM[rr, aa]
z = abs(AUCs[i - 1] - AUCs[j - 1]) / np.sqrt(SE1 ** 2 + SE2 ** 2 + 2 * r * SE1 * SE2)
pHM[i-1, j-1] = 1.0 - scipy.stats.norm.cdf(z)
pHM[j-1, i-1] = pHM[i-1, j-1]
return pHM, CI