-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide a way to get test set predictions from evaluate
#837
Comments
Thanks @ericphanson for flagging this. There was a request for this a while ago by @CameronBieganek, but I can't find it just now. Sometimes this might introduce scaling issues, for large datasets, in particular ones with multi-targets (think of time-series, for example), which becomes worse if we are doing nested resampling, as in evaluating a Another minor issue, is which "prediction" to return, or whether to return more than one kind. For a probabilistic predictor, some metrics will require The function where all this is happening, which will need to add the desired predictions to it's return value is here. |
I am not very familiar with the It sounds like the most straightforward approach is to add a However that kind of design always feels like perhaps we aren't "inverting control to the caller" and that a more compositional flow might be better overall. E.g. I could imagine |
Yes, a compositional approach sounds better. I probably don't have the bandwidth for that kind of a refactor but if someone else was interested... |
I'm curious, what is your use case for collecting the out-of-sample predictons? Are you doing some kind of model stacking perhaps? We have do have |
No, I just want to do my own evaluation on the predictions. In this case, I have multichannel data, and my model is trained to work on each channel independently. But in addition to the evaluation on that task, I want to also combine predictions over channels and then evaluate the aggregated results. I could probably do this by formulating a new composite model (I think?) but if I could just get the predictions directly, I can do whatever evaluation I want. I have also come across this need other times, e.g. I want to plot prediction vs label for my whole dataset (can be important if you don't have a lot of data). CV lets you get useful predictions for all data points, even if there are really Another case can be if you want to evaluate on different stratifications of the data. E.g. what if I wanted to know how my performance varies by channel (on models trained on all channels- I don't want to move one channel all to the test set, e.g.). If I have all the predictions it's easy to do any kind of evaluation needed. |
Just wanted to add that I would also find it very helpful to be able to access the out-of-fold predictions from |
Just a note that this is more doable now that we have a separate |
Like https://scikit-learn.org/stable/modules/generated/sklearn.model_selection.cross_val_predict.html (pointed out by @josephsdavid!)
Currently, I am doing it manually, which works fine:
It would be nice if
evaluate
could give the predictions as well, since it needs to generate them anyway.The text was updated successfully, but these errors were encountered: