factor_agent.exported.ranked_function#

ranked_function(graphs, presence=None, directions=None)[source]#

One KunQuant function with an output per graph, named after it, ranked across the market.

A graph whose directions entry is -1 (a higher value went with a lower return) is output as one minus its rank, so every output reads the same way: a higher value, a higher return.

KunQuant’s Rank leaves a missing value missing and ranks the finite values among themselves. presence maps a graph’s name to the name of a second output, 0 where the graph itself has a value and NaN where it has none, read raw (never neutralised, so a symbol without exposures still counts) and before any fill: it is computed from Graph.without_fills, so a missing value a SetInfOrNanToValue fills stays missing in it.