scikit-learn-contrib / skdag

A more flexible alternative to scikit-learn Pipelines
MIT License
30 stars 8 forks source link

Support cross_val_predict for stacked estimators #27

Open skylarbpayne opened 1 year ago

skylarbpayne commented 1 year ago

First -- this library looks great, pretty much exactly what I was looking for!

It appears though, that each dependent estimator is trained on the entire passed dataset directly. This can lead to overfitting. Instead, it would be nice if cross_val_predict was supported in some fashion so when we have estimators A -> B, B is trained on output of cross_val_predict rather than raw predict output.

Given activity in this repo, I'm assuming its basically inactive. But if not, I'd be happy to contribute such functionality.

big-o commented 1 year ago

Hi and thanks for the feedback! The project is very much active, although I'm running it alone in my spare time so may be sporadic and slow to reply - apologies for that.

I would have expected the sklearn cross_val* functions to work since the DAG should respect the estimator API, so if it doesn't then this sounds like a bug.

If you're interested in contributing a PR that would be very welcome and I'd be happy to review it.