Data Science, Machine Learning, Linear Models, Regression, Python.
LinearRegression() fitted_ols_model = ols_model.fit(X, y) ols_predictions = ols_model.predict(test_X) print(ols_predictions) [[ 2.85362319] [ 0.41884058] [ 2.04202899] [ 1.23043478] [-0.23333333]] The predictions don’t look too bad, but notice that one of the predictions ends up being negative! In