Screen Link: https://app.dataquest.io/m/132/overfitting/3/biasvariancetradeoff
I wanted to write a code to estimate the bias and variance of a model by repeatedly sampling train data as mentioned in link: http://scott.fortmannroe.com/docs/BiasVariance.html
I have written the steps for doing this below. Please let me know if my understanding of the concepts is correct:

Resample train data 5 times to fit 5 models

Using each of these 5 models predict the values for train data. Assume these to be cols P1 to P5 in dataset which will look something like this:

E[f_hat(x)] = mean(P1 to P5) for each row in train set

Bias for each row, B = E[f_hat(x)]  Actual values in train (assuming actual value in train to be f(x) i.e. the true function)

Variance for each row, var = variance(p1 to p5)
Overall Bias = mean(All B**2 values computed in 4)
Overall Variance = mean(All var values computed in 5)
Please let me know if the above steps are correct.