Skip to content

Commit

Permalink
perf_metric: fix DeprecationWarning: Conversion of an array with ndim…
Browse files Browse the repository at this point in the history
… > 0 to a scalar is deprecated, and will error in future.
  • Loading branch information
nilfm99 committed Mar 25, 2024
1 parent e98cbff commit 38a09da
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion python/vmaf/tools/sigproc.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,9 @@ def calpvalue(aucs, sigma):
# pvalue = 2 * (1 - normcdf(z, 0, 1));
l = np.array([[1, -1]])
z = np.abs(np.diff(aucs)) / np.sqrt(np.dot(np.dot(l, sigma), l.T))
pvalue = 2 * (1 - scipy.stats.norm.cdf(z, loc=0, scale=1))
# numpy returns a 2-dimensional array with shape (1, 1), extract the element
z_val = z[0, 0]
pvalue = 2 * (1 - scipy.stats.norm.cdf(z_val, loc=0, scale=1))
return pvalue


Expand Down

0 comments on commit 38a09da

Please sign in to comment.