Linear Regression Overview
- 30Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
- spaceFlip card
- KI knew it
- DI didn't know it
- āPrevious card
- āNext card
What is the primary purpose of regression analysis?
To understand the relationship between two or more variables by creating a predictive model.
Or swipe the card
30 cards
What is the primary purpose of regression analysis?
To understand the relationship between two or more variables by creating a predictive model.
In regression analysis, what are the roles of dependent and independent variables?
The dependent variable (target) is the outcome being predicted, while independent variables (features) are the predictors used to explain or forecast the dependent variable.
What distinguishes linear regression from other regression methods?
Linear regression models the relationship as a straight line (or hyperplane) using a linear equation, assuming a linear relationship between dependent and independent variables.
What type of dependent variable is required for linear regression?
The dependent variable must be continuous and numerical.
What is the equation for a simple linear regression model?
y=mx+c (or y=β0ā+β1āx), where m (or β1ā) is the slope and c (or β0ā) is the intercept.
In simple linear regression, what does the coefficient (slope) represent?
It represents the change in the dependent variable for a one-unit increase in the independent variable.
How does linear regression make predictions?
By plugging the independent variable values into the fitted linear equation to compute the predicted dependent variable.
What is a residual (or error) in linear regression?
The difference between the actual observed value and the value predicted by the regression line: e=yactualāāypredictedā.
What is the Residual Sum of Squares (RSS) and how is it used?
RSS = ā(yiāāy^āiā)2. It quantifies the total discrepancy between actual and predicted values; the best fit line minimizes RSS.
What is the best fit line in linear regression?
The line that minimizes the sum of squared residuals (RSS) among all possible lines.
What optimization algorithm is commonly used to find the best fit line in linear regression?
Gradient descent (or ordinary least squares analytically).
Explain the concept of gradient descent in linear regression.
Starting from random coefficients, gradient descent computes the gradient of the cost function (RSS) and moves in the direction that reduces error, repeating until convergence to a minimum.
What is multiple linear regression?
An extension of simple linear regression with two or more independent variables. The model takes the form y=b0ā+b1āx1ā+b2āx2ā+...+bnāxnā.
In multiple linear regression, what does each coefficient (biā) represent?
The expected change in the dependent variable for a one-unit increase in that independent variable, assuming all other independent variables are held constant.
What is multicollinearity and why is it a problem in linear regression?
Multicollinearity occurs when independent variables are strongly correlated with each other. It inflates coefficient variances, making estimates unstable and interpretation unreliable.
How can multicollinearity be addressed?
By removing highly correlated variables, combining them into a single composite variable (e.g., using PCA), or using regularization techniques like Ridge regression.
What is the coefficient of determination (R2)?
R2 measures the proportion of variance in the dependent variable that is explained by the independent variables. It ranges from 0 to 1, with higher values indicating better fit.
What is the difference between R2 and Adjusted R2?
Adjusted R2 penalizes the inclusion of irrelevant predictors, adjusting for the number of independent variables. It can decrease when useless variables are added, unlike R2 which always increases.
What is Root Mean Squared Error (RMSE) and how is it interpreted?
RMSE = n1āā(yiāāy^āiā)2ā. It gives the average prediction error in the same units as the dependent variable.
How is the correlation coefficient (r) used in linear regression?
r measures the strength and direction of the linear relationship between two variables, ranging from -1 to +1. It helps select strong predictors (close to -1 or +1) and discard weak ones (near 0).
Why might r be non-zero even when there is no linear relationship?
Sampling variability can produce asymmetric distributions, leading to a non-zero r by chance. This is called a 'fluke' or 'fake' correlation.
What are the key assumptions of linear regression?
- Linearity: linear relationship between y and each x. 2. Independence of errors. 3. Homoscedasticity: constant variance of residuals. 4. Normality of residuals. 5. No multicollinearity among predictors.
What does homoscedasticity mean and how is it checked?
Homoscedasticity means the variance of residuals is constant across all levels of the independent variables. It can be checked by plotting residuals vs. fitted values; a random scatter indicates homoscedasticity, while a funnel shape indicates heteroscedasticity.
How do outliers affect linear regression?
Outliers can pull the best fit line toward them, distorting the slope and intercept, leading to a poor model. Linear regression is sensitive to outliers.
What is a limitation of linear regression when data is non-linear?
If the relationship between variables is not linear, linear regression will produce poor predictions. However, data scientists can sometimes transform variables (e.g., x2) to capture non-linearity while still using linear regression.
Why is it important to split data into training and testing sets?
To evaluate model performance on unseen data. Training set builds the model; testing set assesses its generalization ability, preventing overfitting.
What is a low variance filter and why is it used?
A low variance filter removes columns that have very little variability (e.g., one dominant value). Such columns provide no predictive power and may introduce noise.
How are missing values typically handled in linear regression?
Missing values can be imputed (e.g., with median or mean), removed, or predicted using other variables. The choice depends on the pattern and amount of missingness.
What is one-hot encoding and when is it used?
One-hot encoding converts categorical variables (e.g., gender: Male/Female) into binary dummy variables (0/1) for use in regression. It avoids introducing ordinality.
What is the purpose of scaling in linear regression?
Scaling (standardization or normalization) does not affect the model's fit but helps in interpreting coefficients when variables have different units. It is not required for ordinary least squares but may speed up gradient descent.

Ask anything
We've read this whole study set, so questions about it get the best answers.