changeset 185:7c5efd56ce17

change heatmap to by percentile
author Henry S. Thompson <ht@inf.ed.ac.uk>
date Tue, 28 Nov 2023 10:22:38 +0000
parents 9aac9b8552d2
children 75cc26b307be
files lib/python/cc/ccstats.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lib/python/cc/ccstats.py	Tue Nov 28 10:21:36 2023 +0000
+++ b/lib/python/cc/ccstats.py	Tue Nov 28 10:22:38 2023 +0000
@@ -219,10 +219,13 @@
       for q in target_names:
         basis=SS[f'{basis_ym} {p}']
         target=SS[f'{target_ym} {q}']
+        tmin,tmax = target.all_s.minmax
+        twidth = tmax - tmin
         best = (stats.describe(target.all[np.array(basis.iranks_by_all[:n])]).mean
                 for n in nn)
+        bestiles = (round((b - tmin) / twidth, 3) * 100 for b in best)
         print(f"{q} by {p}",
-              "\t".join(['{:6.4g}']*len(nn)).format(*best),
+              "\t".join(['{:4.3g}']*len(nn)).format(*bestiles),
               sep="\t",file=outfile)
 
 def predict(basis_ym, basis_name, target_ym, target_name, n):