reuse common schemas in lale.lib.sklearn
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
fitandpredict: https://github.com/IBM/lale/blob/1f0339748e907b33ccc58e51f5b31e3589026233/lale/lib/aif360/disparate_impact_remover.py#L120-L122 - schema reuse for common hyperparameters: https://github.com/IBM/lale/blob/1f0339748e907b33ccc58e51f5b31e3589026233/lale/lib/aif360/disparate_impact_remover.py#L131 and https://github.com/IBM/lale/blob/1f0339748e907b33ccc58e51f5b31e3589026233/lale/lib/aif360/disparate_impact_remover.py#L138
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