bias and variance calculation for linear regression
So in terms of a function to approximate your population, high bias means underfit, high variance overfit. To detect which, partition dataset into training, cross validation and test sets.
A low training error but high cross validation error means its overfit. 
A high training error means its underfit. 
High Bias: add polynomial features, get more samples. High Variance: increase regularisation (squeeze polynomial parameters small), or gather more data so it trains better
If we have 4 parameters of X_train, y_train, X_test, and y_test, how can we calculate the bias and variance of a machine learning algorithm like linear regression?
I have searched a lot but I could not find a single code for this.