diff options
author | Florian Jung <flo@windfisch.org> | 2015-08-26 00:12:07 +0200 |
---|---|---|
committer | Florian Jung <flo@windfisch.org> | 2015-08-26 00:12:07 +0200 |
commit | 0b0d7102b6efc629558a7a42fe869ac8b3f9319e (patch) | |
tree | cd2fe8e6ec78653e932ee7f9d5815c9ee798a79e /stats.py | |
parent | 6a1f478e2168479f88de293a493ce6509d73f03f (diff) |
find out zoom level w.r.t size
Diffstat (limited to 'stats.py')
-rw-r--r-- | stats.py | 17 |
1 files changed, 16 insertions, 1 deletions
@@ -171,6 +171,7 @@ class Stats: def analyze_visible_window(self): svw = {} ratios = [] + print("size\tdiag") for size, rects in sorted(self.data.size_vs_visible_window.items(), key=lambda x:x[0]): maxwidth = quantile(sorted(map(lambda x:x[0], rects)), 0.95) maxheight = quantile(sorted(map(lambda x:x[1], rects)), 0.95) @@ -180,4 +181,18 @@ class Stats: print(str(size)+"\t"+str(math.sqrt(maxwidth**2+maxheight**2))) - print (quantile(sorted(ratios),0.5)) + print ("median ratio = "+str(quantile(sorted(ratios),0.5))) + + coeff_vs_stddev=[] + for coeff in [x/100 for x in range(10,100,1)]: + quotients = [] + for size, rect in svw.items(): + if size != 0: + diag = math.sqrt(rect[0]**2+rect[1]**2) + quotients += [diag / size**coeff] + + coeff_vs_stddev += [(coeff, avg(quotients), stddev(normalize(quotients)))] + + best = min(coeff_vs_stddev, key=lambda v:v[2]) + + print("diag / size**"+str(best[0])+" = "+str(best[1])) |