evalml icon indicating copy to clipboard operation
evalml copied to clipboard

Support monotonic constraints

Open kmax12 opened this issue 5 years ago • 5 comments

We should allow a user to specify if they want to impose monotonic constraints on any of the variables that are feeding into their model.

Not all modeling approaches support this. Xgboost does

  • https://xgboost.readthedocs.io/en/latest/tutorials/monotonic.html

kmax12 avatar Nov 05 '19 15:11 kmax12

API needs

  • how does a user to specify this?
  • how does the automl know which pipelines support this option?

kmax12 avatar Nov 18 '19 16:11 kmax12

Great. I think LightGBM supports this too.

This could be a boolean option called monotonic specified as an automl search option. We could add a supports_monotonic boolean tag to pipelines (PipelineBase, perhaps) which defaults to false, then override that to true in specific subclasses. Then, if monotonic was specified as true in the automl configuration, the get_pipelines method could be updated to only return xgboost and other models with support for monotonicity constraints.

dsherry avatar Dec 09 '19 20:12 dsherry

regarding the api, is monotonic applied per variable or globally across all variables?

kmax12 avatar Dec 11 '19 16:12 kmax12

Looks like catboost also has some support for this and also provides demo datasets. Both XGBoost and CatBoost use a similar API where the user passes in a list of (-1, 0, 1) for each feature to specify monotonic relationships. Could follow this approach (or if user just passes in an int, we assume that it is applied globally)?

angela97lin avatar Dec 12 '19 16:12 angela97lin

This would be great to circle back to once the automl strategy project #272 is complete. In particular, we could define some pipelines as supporting monotonicity constraints, and if an automl search is configured with this constraint enabled, we only try those pipelines.

dsherry avatar Apr 13 '20 23:04 dsherry