Do these values of bias and variance make sense?
I have this code:
X_train, X_test, y_train, y_test = train_test_split(X, Y, test_size=0.3, random_state=1)
model = LinearRegression().fit(X_train, y_train)
from mlxtend.evaluate import bias_variance_decomp
print(y_train.min(), y_train.max(), y_test.min(), y_test.max())
#for your understanding of the data: 7283 517924 11510 450000
avg_expected_loss, avg_bias, avg_var = bias_variance_decomp(
model, X_train, y_train.ravel(), X_test, y_test.ravel(),
loss='mse', random_seed=1)
print('Average expected loss: %.3f' % avg_expected_loss)
print('Average bias: %.3f' % avg_bias)
print('Average variance: %.3f' % avg_var)
The result is:
Average expected loss: 542162695.679
Average bias: 529311955.129
Average variance: 12850740.550
To me, these values seem to be too high. Am I missing something or this correct?
Topic bias variance scikit-learn python machine-learning
Category Data Science