Back to Community
New Pipeline Features: fillna, if_else, and Row-Wise Computations.

Hi everyone,

We recently added a number of methods to pipeline that should make it easier to perform certain computations. Here is a list of the methods that were recently added, with links to their respective entries in the API reference:
- Factor.fillna
- Classifier.fillna
- Filter.if_else
- Factor.sum
- Factor.mean
- Factor.median
- Factor.notnull_count
- Factor.stddev
- Factor.max
- Factor.min

{Factor|Classifier}.fillna is useful when combining factors. Filter.if_else is useful if you want to switch between two pipeline terms depending on the result of a filter. For instance, you might define a filter to detect regimes for a particular asset and pick between two different factor definitions depending on which regime the asset is in.

Factor.{sum|mean|median|notnull_count|stddev|max|min} are different than other Factor methods in that they are row-wise operations. This means that they compute aggregations across assets each day, producing a scalar output. An example use case for this type of computation is transforming factor scores into weights. There is a new cookbook entry that demonstrates how Factor.sum can be used to achieve this transformation. There is also a new subsection in the Pipeline User Guide that further discusses row-wise computations in pipeline.

Hopefully this makes it easier to define common computations with less boilerplate code!




1 response

This is great, thank you guys! Makes it easier to do more complicated computations on factors and write lesser, buggy boilerplate code.