pwollstadt/IDTxl

Restructuring estimators using multiple inheritance

daehrlich opened this issue · 0 comments

I suggest restructuring the estimator classes by implementing abstract estimator classes for the different quantities that can be estimated (EstimatorMI, EstimatorCMI, EstimatorTE, EstimatorAIS); as well as an EstimatorDiscrete superclass with corresponding children (EstimatorDiscreteMI, ...) in the estimator class. All estimators that estimate the particular quantity should inherit from one of these classes in addition to their inheritance from the implementation-related superclasses.

For example, JIDTDiscreteTE would inherit from JIDTEstimator, which handles starting the JRE, and from EstimatorDiscreteTE, which handles discretisation of continuous data (via its superclass EstimatorDiscrete).

The abstract estimators (EstimatorMI, ...) clearly indicate which estimators are interchangeable from the point of view of the algorithms and allow for assertions to be added which make sure that an estimator of the correct quantity is submitted in an algorithm's settings. Furthermore, they avoid duplicate code, e.g. both JIDTEstimatorDiscrete and the upcoming bayesian estimators for discrete distributions may share the same discretisation methods.