Applying Business Rules

Business rules are applied using a single main function that is a simple transformation on the typical output of many recommendation algorithms in the form of item-score lists. This function is composed of substep-functions representing each of the existing business rules, while consolidating their common metadata and computed model dependencies.

Each substep can rescore recommended items or completely remove them from the recommendation set. After each rescoring substep, the recommendation set is re-sorted to obtain a new ranking of items.

Right now, the code for both the main function and all wanted substeps needs to be copied into each endpoint notebook where business rules should be applied.

Note

The exact mechanisms, data formats, and required dependencies are best understood by studying the annotated example notebook for applying business rules: pipe_algorithms > notebooks > tutorials > business-rules > business_rules_applied.ipynb