fmind/mlops-python-package

[FEAT] Abstracting the `Model` base class to be re-usable for multiple modelling use cases

moleary-gsa opened this issue · 1 comments

Description

It would be nice to abstract the model base class outside the bikes package into a more generic package within the repo that could be used for more use cases.

Motivation

To undertake another modelling task it would seem logical to add another package alongside bikes, for example; taxis for a NY Taxi data modelling use case.

A second use case should be able to make use of most of the base abstractions within the bikes package such as the Job, Model, Metric and Schema base classes and this is where it feels natural to pull out those abstractions to a package which is generic alongside the src package or above it maybe?.

I'm not an expert in python package project layouts but the main point being that the taxis and bikes packages would be completely separate and depend on a single, framework style package instead of copying across most of the components within the bikes package.

Solutions

I have tried to do this on a fork of the repo here but am unable to pass mypy checks because I don't know how to handle the schema dependency on the Model base class.

In the bikes package, the Model base class is dependent on the concrete Inputs, Target and Outputs types and I can't seem to figure out how to remove this dependency and avoid the Liskov substitution violation from mypy while keeping the fact that the interface should only accept pandera schemas intact.

Any ideas?