Reading-Notes
Code Fellows Python 401
Read: 12 - Linear Regressions
How to Run Linear Regression in Python
linear regression is a linear approach for modelling the relationship between a scalar response and one or more explanatory variables Scikit-learn is a Python module for machine learning. In linear regressions, Y represents the depending variable and X represents the independent variable(s).
Important functions:
- lm.fit() - fits a linear model
- lm.predict() - Predict Y using the linear model with estimated coefficients.
- lm.score() - Returns the coefficient of determination (R^2)
-
lm.coef_&lm.intercept_ - give the coefficients and estimated intercepts of a model.
- Residual plots - can be used to visualize errors in data.
Additional Resources
- Video: Introduction to Simple Linear Regressions