Closed emorice closed 2 years ago
However, the obtained class has only one method, so you simply keep it as a function and assign it to the "children" classes instead of inheriting.
In that case, we don't have inheritance at all in the end. However, we still bundle fit/predict in classes. It's still a bit weird, but that's a rather well-accepted pattern it seems.
Also we end up with classes with only static methods. In that case you may just as well register the module itself, add_module
has been added to the new models.methods
for this.
There are still useless classes for now, to be eliminated over time, but I think we have a mix of two valid patters now anyway.
The inheritance between models sometimes makes no sense as a class may implement a
fit
method that is completely incompatible with the parent's.Since the inheritance was meant to allow delegating
predict_loo
methods mostly, these should be factored away in abstract classes that lack a concrete fit.