Question: Finding the Bootstrap Prediction Interval predictions about a bird's weight based on the weight of the corresponding egg. However, just as we're uncertain about the

Finding the Bootstrap Prediction Interval
predictions about a bird's weight based on the weight of the corresponding egg.
However, just as we're uncertain about the slope of the true regression line, we're also uncertain about the predictions made based on the true regression line.
Question 2.1. Define the function fitted_value . It should take in four arguments:
table: a table like birds. We'll be predicting the values in the second column using the first.
x?col : the name of our x-column within the input table
y_col : the name of our y-column within the input table
given_x : a number, the value of the predictor variable for which we'd like to make a prediction.
The function should return the line's prediction for the given x.
Hint: Make sure to use the fit_line function you defined in Question 1.3.
Fit line function:
def fit_line(tbl, x_col, y_col)
x = tbl[x_col]
y = tbl[y_col]
slope,intercept = np.polyfit(x,y,1)
return [slope, intercept]
fit_line (birds, "Egg Weight" , "Bird Weight")
Finding the Bootstrap Prediction Interval

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!