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
directionsentry 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
Rankleaves a missing value missing and ranks the finite values among themselves.presencemaps 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 fromGraph.without_fills, so a missing value aSetInfOrNanToValuefills stays missing in it.