sequence function: frequency-class
description:
frequency-class(ket, sp)
implement the frequency class equation
see: https://en.wikipedia.org/wiki/Word_lists_by_frequency#Statistics
the algorithm:
drop all elements <= 0 from X
smallest = the min coeff in X
largest = the max coeff in X
f = the value of e.label in X
if largest <= 0:
return 0
if f <= 0:
return math.floor(0.5 - math.log(smallest / largest, 2)) + 1
return math.floor(0.5 - math.log(f / largest, 2))
examples:
see also:
normed-frequency-class, map-to-topic
Home