ExponentialWeights

class frlearn.weights.ExponentialWeights(base: float = 2)[source]

(8/15, 4/15, 2/15, 1/15) Exponentially decreasing weights with parametrisable base.

Parameters
base: float

Exponential base. Should be larger than 1.

Returns
f: int -> np.array

Function that takes a positive integer k and returns a weight vector of length k with exponentially decreasing weights with base b.

Notes

With base 2, weights rapidly approach 0, meaning:

  • the resulting weight vector is not very useful, and quickly becomes insensitive to increasing k,

  • using large values for k will produce weights that are so small as to cause computational wonkiness.

These issues are exacerbated for larger bases, so bases only slightly larger than 1 may be most useful.