in clearbox/features.py [0:0]
def __init__(self, arg: Node, k: float, group_by: Node | None = None):
"""Initialize the recipical rank node.
Args:
arg: Node to evaluate and apply reciprocal rank transformation to.
k: Constant to add to the ranks in the denominator of the reciprocal rank
formula.
group_by: If provided, the node is evaluated and the value is used to
group the `arg` node evaluation results into a non-overlapping clusters.
The reciprocal rank is then computed separately for each cluster.
`group_by` is not supported in the Proto format so it's not serialized.
"""
if k < 0:
raise ValueError("`k` should be non-negative.")
self._arg = arg
self._k = k
self._group_by = group_by