Skip to content

Implement new basic recsystem interface

E. Madison Bray requested to merge embray/issue-12 into master

First attempt at implementing the design I discussed in #12 (closed)

  • Renames renewal_recsystem.baseline.BaselineRecsystem to renewal_recsystem.basic.BasicRecsystem

  • BasicRecsystem implements the interface for loading hook/callback functions from a Python module (can either be a .py file or the name of an importable module)

    • RecsystemHooks implements the interface for what hooks recsystems must/may implement. I'm not super happy with the implementation yet so consider this a WIP.
  • The built-in baseline recsystems 'popularity' and 'random' are now implemented as hook modules using the BasicRecsystem interface.

  • The basic recsystem can now be run just with python -m renewal_recsystem

    • Likewise, the baselines can be run like

      python -m renewal_recsystem renewal_recsystem.baseline.random

      They require the full module name (as opposed to just 'random', for example) because they are not otherwise treated as "special". They are using the same interface contestants would use to implement their recsystems, so it both tests that interface and provides some very simple sample implementations.

TODO:

  • Add a User class for providing better information about users; currently just the user_id is passed to recsystems, which is pretty useless.

  • Maybe replace ArticleCollection with a pandas DataFrame (see #13 (closed))

  • As discussed in #12 (closed) add a more non-trivial example recsystem that does some content-based ranking of articles.

  • Add a process-shared scratch space for contestants to pass their own data between hooks/callbacks

Edited by E. Madison Bray

Merge request reports