fips.kernels.RaggedTimeDecay#

fips.kernels.RaggedTimeDecay(time_dim, scale, decay_func=<function _exponential_decay>)[source]#

Create a ragged temporal decay kernel.

Defaults to exponential decay, but can accept any math function.

Parameters:
  • time_dim (str) – Name of the time dimension in the input DataFrame.

  • scale (str or pd.Timedelta) – Scale parameter for the decay function. If a string is provided, it will be converted to a pd.Timedelta.

  • decay_func (callable, optional) – A function that takes a distance matrix and a scale parameter and returns a decay matrix. Defaults to the exponential decay function.

Returns:

A kernel function that can be applied to a DataFrame to compute the temporal decay matrix based on the specified time dimension and scale.

Return type:

function