artefactual.scoring.FunctionPooling#
- class artefactual.scoring.FunctionPooling(fn)[source]#
Bases:
PoolingA plain function f(x, axis) as a Pooling, named after the function.
A lambda or a functools.partial is named “pooling”; define the function with def to name it.
- Parameters:
fn (callable) – fn(x, axis) pooling the axis of x, whose last axis is the rank axis, to (…, n_features).
Methods
feature_namesOne name per feature, given the rank column names.
widthFeatures the pooling returns for k candidates per token.