model = LinearRegression()
model.fit(x_poly,current_y)

expected_fcap = np.mean(f_cap,axis=0) # f_cap stores the predicted outputs for the different models.
# expected_fcap is average of all models (expectation)
bias=np.mean(abs(expected_fcap-y_test)) # Bias is calculated for each degree using expected_cap
total_bias.append(bias) # and data from testing model.
variance=np.mean(np.var(f_cap, axis=0)) # Variance is calculated for each model individually and then
total_variance.append(variance) # mean has been taken to calculate for each degree.