Welcome to Brannon's Reading Notes!

This serves as my personal page to keep and update my reading notes for Code Fellows Courses 201, 301, and 401.

Reading 13

Linear Regression

A linear regression takes an explanatory variable and a response variable and plots their relationship via scatterplot. A line is then drawn through the plots that represents the expected relationship between the two variables, based on that data.

import sklearn
from sklearn.linear_model import LinearRegression

A Few Important Linear Regression Methods:

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). A measure of how well observed outcomes are replicated by the model, as the proportion of total variation of outcomes explained by the model.

source: https://bigdata-madesimple.com/how-to-run-linear-regression-in-python-scikit-learn/