-
Notifications
You must be signed in to change notification settings - Fork 46
Architecture
Following the proposal for groundrules, we want to try and mimic the class inheritance structures found in scikit. These structures require some modifications to account for the unique properties of regionalization. This doc is a brainstorm of how those conventions will need to be modified, and will serve as a guide for constructing spopt classes
spopt/
base.py
spopt.region/
spopt.allocate/
spopt.route/
scikit uses BaseEstimator and ClassMixins to for every structure in the library. We want to follow a similar convention, providing a BaseClass, and appropriate mixins for each class. Rather than Estimator
, we think Solver
is a more appropriate and descriptive verb.
In scikit, the estimator classes hold model parameters, and are indifferent toward data used to fit/solve the model. For regionalizers, this same pattern is complicated to mimic for two reasons: first,
-
W
objects cannot be abstracted away from a design matrix entirely because it is conditioned on values in D (i.e. missing values in D need to be removed from W. In theory this could be done by initializing the regionalizer with the "full" W, and subsetting it according to missing values in D, but that strategy would not work for, e.g. KNN weights, where dropping observations could violate the defined K - the regionalizers dont really have the concept of "transform" or "assign" new observations based on the existing model