Problem
I've tried reading this resource on the naming conventions for common Python design patterns, but I can't find a pattern that matches the class I'm creating.
The closest I could find was the Composite Pattern, although I don't feel that matches my use case.
About the Class
I'm working on a Machine Learning Explainability package. One way of explaining a model is to build a simpler surrogate
model that mimics the behaviour of the complex model.
A common way to implement this is the SHAP algorithm, which requires you to sample the dataset that you used to create the original complex model.
How you sample is dependent on a single row of features, which you build the surrogate
model around. This makes it useful to have a Sampler
object that stores the background dataset and takes a single row as input.
This gives me three strongly related complex objects and one dataset. It makes sense to me to store these in the same place and obfuscate their connections with a simple interface.
However, I don't think this is an interface because the methods won't change to match the objects. The class will not be abstract, and it will hold all the important data.
I'd like to contain the functionality for building the surrogate
model, and Sampler
inside this class too. So it's partially a Factory design pattern.
Question
Is there a pre-existing name for a class like this? Maybe the BORG design pattern? Or should I have rethink before I create something like this?