Machine Learning, Regression, Data Science.
lr_model = LinearRegression(fit_intercept=True) lr_model.fit(x_train, y_train) y_pred = lr_model.predict(x_test) print("Coefficients or slope: \n", lr_model.coef_) print("Model intercept:", lr_model.intercept_) print("Mean squared error: %.2f" % mean_squared_error(y_test, y_pred))