【发布时间】:2021-04-28 14:02:23
【问题描述】:
嗨,我在 (mean_squared_error=(y_test,y_pred)) 这个命令之后我没有得到任何输出,并且在 lr_fit(x_train ,y_train) 之后我只得到线性回归
【问题讨论】:
标签: python jupyter-notebook linear-regression
嗨,我在 (mean_squared_error=(y_test,y_pred)) 这个命令之后我没有得到任何输出,并且在 lr_fit(x_train ,y_train) 之后我只得到线性回归
【问题讨论】:
标签: python jupyter-notebook linear-regression
# doesn't return anything
# it just fit the model
# https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LinearRegression.html
lr.fit(x_train, y_train)
# to get mean squared error, the correct syntax is
mae = mean_squared_error(y_test,y_pred)
print(mea)
【讨论】: