Untitled
Anonymous
plain_text
02/24/2026 7:20 AM
520 B
11
Indexable
from sklearn.metrics import r2_score
test_x_np = np.asanyarray(test_x[['ENGINESIZE']])
test_y_np = np.asanyarray(test_y[['CO2EMISSIONS']])
test_y_ = regr.predict(test_x_np)
print("Mean absolute error: %.2f" % np.mean(np.absolute(test_y_ - test_y)))
print("Residual sum of squares (MSE): %.2f" % np.mean((test_y_ - test_y) **2))
print("R2-Score: %.2f" % r2_score(test_y, test_y_))Editor is loading...
Leave a Comment