For homework, I was given data to create/train a predictor that uses lasso regression. I create the predictor and train it using the lasso python library from scikit learn.
So now I have this predictor that when given input can predict the output.
The second questions was to "Extend your predictor to report the confidence interval of the prediction by using the bootstrapping method."
I've looked around and found examples of people doing this for the mean and other things.
But I am completely lost on how I'm suppose to do it for a prediction. I am trying to use the scikit-bootstrap library.
The course staff is being extremely unresponsive, so any help is appreciated. Thank you.
Best Answer
Bootstrapping refers to resample your data with replacement. That is, instead of fitting your model to the original X and y, you fit your model to resampled versions of X and y for multiple times.
Thus, you get n slightly different models which you can use to create a confidence interval. Here is a visual example of such an interval.