Linear Regression

How to run Linear regression in Python scikit-Learn?

What is Scikit-learn?

a powerful Python module for machine learning. It contains function for regression, classification, clustering, model selection and dimensionality reduction.

Training and validation data sets

lm = LinearRegression() lm.fit(x_train, y_train) pred_train = lm.predict(x_train) pred_test = lm.predict(x_test)

Residual Plots

Residual plots are a good way to visualize the errors in your data. If you have done a good job then your data should be randomly scattered around line zero