Код: Выделить всё
from sklearn.metrics import r2_score, mean_squared_error
# Assuming Y is the actual values and ypipe is the predicted values
print('MSE for multi-variable polynomial pipeline is: ', mean_squared_error(Y, ypipe))
print('R^2 for multi-variable polynomial pipeline is: ', r2_score(Y, ypipe))
Код: Выделить всё
TypeError: 'numpy.float64' object is not callableЭто также появляется при расчете r2_score для полиномиальной регрессии
введите здесь описание изображения
Подробнее здесь: https://stackoverflow.com/questions/786 ... calculatin