Ordinary Least Squares, P Value, Regression, Statsmodels.
Either R2 score coming from training dataset or test dataset is the same in Scikit-learn and in StatsModel. Visualization y_train_predict=sm_ols.predict(X_train_sc_cst) plt.scatter(y_train_predict,y_train,label='train') plt.scatter(y_test_pred,y_test,label='test') plt.plot(y_train,y_train,'-r')