Repository navigation
support parameter-specific base learners - #411
Conversation
Allow Base to be a sequence of estimators matching the distribution parameter count, while preserving the existing single-estimator behavior. Add regression and classification coverage for per-parameter learners.
Validate base learner sequences before mutating fit state, document the distribution-parameter ordering, support nested Base parameter updates, and add regression coverage for tuple bases, monotonic constraints, sample weights, sklearn cloning, and feature importances.
|
hi @sarptandoven , happy to merge this if you can fix the lint errors (and it looks like this supersedes #410 which should be closed?) |
|
Here's a possible fix:
After this: pylint 10.00/10 (exit 0), black --check and isort --check-only unchanged, and make lint would pass alongside the already-green make test (65 passed, 57 skipped). |
|
@alejandroschuler, I'll run a couple tests after linting gets fixed and pub a release but will review in the next day |
I did a simple local test and these suggestions do cause it to pass |
alejandroschuler
left a comment
There was a problem hiding this comment.
this is good, thanks for the contribution. Also fixes a previously unidentified bug that tol and verbose_eval weren't in get_params and so didn't surivvie cloning
ryan-wolbeck
left a comment
There was a problem hiding this comment.
Looks good to me as well, the build times on 3.14 are running longer than it should but I made an issue to investigate but shouldn't block this PR.
Thanks!
summary
adds support for passing one base learner per distribution parameter.
this keeps the existing
Base=DecisionTreeRegressor(...)behavior, and also allows:for distributions like
Normal.this addresses the constrained-location use case from #338 without changing the default path.
changes
Dist.n_paramsBase__max_depthBase__0__max_depthfeature_importances_working for all-tree modelsNonefor mixed learner feature importances instead of failingtests
results:
closes #338