Не удается получить правильные результаты в линейной регрессии

#python #jupyter-notebook #linear-regression

Вопрос:

привет,у меня есть сомнения после (mean_squared_error=(y_test ,y_pred)) этой команды я не получаю никаких выходных данных, а также после lr_fit(x_train, y_train) я получаю только линейную регрессию

Ответ №1:

 # 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)