reuse common schemas in lale.lib.sklearn
hirzel opened this issue · 4 comments
Many operators in lale.lib.sklearn
have similar schemas for fit
, predict
, transform
, predict_proba
, etc. Similarly, there are some hyperparameters that occur in many of the operators in lale.lib.sklearn
, such as random_state
, n_jobs
, etc. We could make our code base smaller and easier to maintain by defining such schemas only once in a file imported by each of the operators, and then plugging them in at the right place.
We already do something like that for lale.lib.aif360
:
- schema reuse for
fit
andpredict
:lale/lale/lib/aif360/disparate_impact_remover.py
Lines 120 to 122 in 1f03397
- schema reuse for common hyperparameters: and
Started a file for this, only used by one operator so far: https://github.com/IBM/lale/blob/master/lale/lib/sklearn/_common_schemas.py
tol
is a good candidate for a shared parameter
Did this for lale.lib.imblearn: https://github.com/IBM/lale/blob/master/lale/lib/imblearn/_common_schemas.py
Did this for lale.lib.autoai_libs: https://github.com/IBM/lale/blob/master/lale/lib/autoai_libs/_common_schemas.py