Hi all,
We have made two small additions to Pipeline:
PercentChange
: a built-inFactor
that calculates the percent change of an input over a given window lengthpeer_count
: a method called onClassifiers
that gives the number of occurrences of each distinct category in the parentClassifier
PercentChange
takes any numeric BoundColumn
as its input, as well as a window length of at least 2. It computes the percent change between the value corresponding to the beginning of the lookback window and the current day. For example, PercentChange
with a window length of 2 would compute the daily percent change for all days in the specified range. This Factor
is virtually identical to the CustomFactor
shown here, but we now account for the use of negative numbers by taking the absolute value of the denominator in the percent change calculation:
(new_value - old_value) / abs(old_value)
You should proceed with caution when your data contains negative numbers, as the percent change formula can sometimes give counter-intuitive results
peer_count
is a Classifier
method that counts, for each Classifier
category, the total number of assets that share the same category label.
Classifiers
output categorical data, and it can be useful to not only know the category that an asset falls under, but also the total number of assets that belong to that category. For example, you might want to filter out outlier categories that contain a small number of assets. This Filter
, as well as a few other examples, are demonstrated in the attached notebook.
Thanks for reading!
- Peter