1. Home
  2. Explore
  3. Mathematics
  4. Regression Analysis Overview

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Regression Analysis Overview

  • 57Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Regression Analysis Basics
  • spaceFlip card
  • KI knew it
  • DI didn't know it
  • ←Previous card
  • →Next card

What is regression analysis?

Tap to flipClick to flipspace

A statistical method to understand the relationship between a dependent variable and one or more independent variables, often used for prediction.

Or swipe the card

57 cards

  1. What is regression analysis?

    A statistical method to understand the relationship between a dependent variable and one or more independent variables, often used for prediction.

  2. What is the difference between a dependent and an independent variable in regression?

    The dependent variable (target) is what you want to predict; independent variables (features) are used to make the prediction.

  3. What type of variable must the dependent variable be in linear regression?

    Continuous numerical.

  4. Write the equation for simple linear regression.

    y=mx+cy = mx + cy=mx+c or y=β0+β1xy = \beta_0 + \beta_1 xy=β0​+β1​x

  5. Write the equation for multiple linear regression.

    y=β0+β1x1+β2x2+⋯+βnxny = \beta_0 + \beta_1 x_1 + \beta_2 x_2 + \cdots + \beta_n x_ny=β0​+β1​x1​+β2​x2​+⋯+βn​xn​

  6. What is the residual in linear regression?

    The difference between the actual observed value and the value predicted by the model: ei=yi−y^ie_i = y_i - \hat{y}_iei​=yi​−y^​i​.

  7. What is the Residual Sum of Squares (RSS)?

    The sum of squared residuals: RSS=∑i=1n(yi−y^i)2RSS = \sum_{i=1}^{n} (y_i - \hat{y}_i)^2RSS=∑i=1n​(yi​−y^​i​)2.

  8. What algorithm is commonly used to minimize RSS in linear regression?

    Gradient descent.

  9. What is the role of the learning rate in gradient descent?

    It controls the size of the steps taken toward the minimum; too large may overshoot, too small slows convergence.

  10. Interpret the coefficient β1\beta_1β1​ in a simple linear regression y=β0+β1xy = \beta_0 + \beta_1 xy=β0​+β1​x.

    For a one-unit increase in xxx, yyy changes by β1\beta_1β1​ units, on average.

  11. What does the intercept β0\beta_0β0​ represent?

    The predicted value of yyy when all independent variables are zero.

  12. Why is data split into training and testing sets?

    To evaluate model performance on unseen data and avoid overfitting.

  13. What is RMSE and how is it calculated?

    Root Mean Square Error: RMSE=1n∑i=1n(yi−y^i)2RMSE = \sqrt{\frac{1}{n} \sum_{i=1}^{n} (y_i - \hat{y}_i)^2}RMSE=n1​∑i=1n​(yi​−y^​i​)2​.

  14. State the assumption of linearity in linear regression.

    The relationship between the dependent and each independent variable is linear.

  15. State the assumption of independence of errors.

    The residuals (errors) are independent of each other.

  16. State the assumption of homoscedasticity.

    The variance of the residuals is constant across all levels of the independent variables.

  17. State the assumption of normality of residuals.

    The residuals are normally distributed (especially important for inference).

  18. What is multicollinearity and why is it problematic?

    High correlation among independent variables; it makes coefficient estimates unstable and hard to interpret.

  19. What is R-squared?

    The proportion of the variance in the dependent variable explained by the model: R2=1−SSresSStotR^2 = 1 - \frac{SS_{res}}{SS_{tot}}R2=1−SStot​SSres​​.

  20. Why is adjusted R-squared preferred over R-squared?

    It penalizes for adding unnecessary predictors, so it can decrease when a useless variable is added.

  21. What does the p-value for a coefficient test?

    Null hypothesis: coefficient = 0 (no linear relationship). A low p-value (<0.05) suggests the predictor is statistically significant.

  22. What is logistic regression primarily used for?

    Classification (binary or multi-class), not regression.

  23. Write the sigmoid function used in logistic regression.

    σ(z)=11+e−z\sigma(z) = \frac{1}{1 + e^{-z}}σ(z)=1+e−z1​ where z=β0+β1x1+⋯+βnxnz = \beta_0 + \beta_1 x_1 + \cdots + \beta_n x_nz=β0​+β1​x1​+⋯+βn​xn​.

  24. How is the decision boundary determined in binary logistic regression?

    If predicted probability ≥0.5\geq 0.5≥0.5, classify as class 1; otherwise class 0.

  25. What cost function is minimized in logistic regression?

    Log loss (cross-entropy): J=−1m∑i=1m[y(i)log⁡(y^(i))+(1−y(i))log⁡(1−y^(i))]J = -\frac{1}{m} \sum_{i=1}^{m} [y^{(i)} \log(\hat{y}^{(i)}) + (1-y^{(i)}) \log(1-\hat{y}^{(i)})]J=−m1​∑i=1m​[y(i)log(y^​(i))+(1−y(i))log(1−y^​(i))].

  26. How does logistic regression handle multi-class classification?

    One-vs-rest (OvR): for each class, train a binary classifier that separates that class from the rest.

  27. What is a confusion matrix?

    A table showing actual vs. predicted classifications: TP, FP, FN, TN.

  28. Define recall (sensitivity) for the positive class.

    Recall=TPTP+FNRecall = \frac{TP}{TP+FN}Recall=TP+FNTP​

  29. Define precision.

    Precision=TPTP+FPPrecision = \frac{TP}{TP+FP}Precision=TP+FPTP​

  30. What is the overall accuracy of a classifier?

    Accuracy=TP+TNTP+TN+FP+FNAccuracy = \frac{TP+TN}{TP+TN+FP+FN}Accuracy=TP+TN+FP+FNTP+TN​

  31. How does class imbalance affect logistic regression?

    The model becomes biased toward the majority class, resulting in poor recall for the minority class.

  32. What is one-hot encoding and when is it used?

    Converting a categorical variable into multiple binary columns, each representing one category. Used when no ordinal relationship exists.

  33. What is label encoding and when is it appropriate?

    Assigning integers to categories (e.g., low=0, medium=1, high=2). Appropriate for ordinal variables.

  34. How do you detect multicollinearity?

    Using correlation matrix (high pairwise correlations) or Variance Inflation Factor (VIF > 10 indicates high multicollinearity).

  35. What is a low variance filter?

    Removing features that have very low variance (e.g., constant values) because they provide little predictive information.

  36. How should missing values in a numeric column be handled?

    Replace with median (less sensitive to outliers) or mean, or use imputation techniques like MICE.

  37. What is the correlation coefficient (r) measuring?

    The strength and direction of linear relationship between two variables, ranging from -1 to +1.

  38. How do you check the normality of residuals?

    Using a Q-Q plot or statistical tests like Shapiro-Wilk.

  39. What does the F-statistic test in linear regression?

    Null hypothesis: all regression coefficients are zero (model has no explanatory power). A low p-value indicates overall model significance.

  40. What is the problem of overfitting?

    The model fits the training data too well, capturing noise, and performs poorly on new data.

  41. Give an example of a linear regression case study from the content.

    Predicting GRE score from CGPA: a simple linear regression with GRE as dependent and CGPA as independent variable.

  42. In multiple linear regression, what is a hyperplane?

    A flat, (n-1)-dimensional surface in an n-dimensional feature space that represents the model.

  43. What are the advantages of linear regression?

    Simple to implement, easy to interpret (white box model), works well with linearly related data.

  44. What are the disadvantages of linear regression?

    Assumes linearity, sensitive to outliers, prone to multicollinearity, requires feature scaling for some interpretations.

  45. How does logistic regression handle outliers?

    It is sensitive to outliers because it uses a linear model. Outliers can distort the decision boundary.

  46. What is the main assumption about the decision boundary in logistic regression?

    It assumes a linear decision boundary (or a hyperplane) separating classes.

  47. What does the intercept in logistic regression represent?

    The log-odds of the event when all predictors are zero.

  48. Explain the 'one-vs-rest' approach for multiclass logistic regression.

    For each class, train a binary classifier that distinguishes that class from all others. The final class is the one with the highest probability.

  49. What is the purpose of a pair plot in data analysis?

    To visualize pairwise relationships between all variables in a dataset.

  50. How can you address multicollinearity?

    By removing one of the correlated variables, combining them (e.g., using PCA), or using regularization (Ridge, Lasso).

  51. What is the difference between a linear and non-linear regression model?

    Linear models have coefficients raised to the first power (e.g., y=β0+β1xy = \beta_0 + \beta_1 xy=β0​+β1​x), while non-linear models have coefficients in exponents or products.

  52. In the diamonds dataset example, what was the target variable?

    Price of the diamond.

  53. What was the RMSE for the simple linear regression on diamonds (price ~ carat)?

    Approximately 1002.121.

  54. Why was the second multiple linear regression model (with x, y, z) worse than the simple one?

    Its RMSE (1574) was higher, likely due to multicollinearity among x, y, z.

  55. How did the diabetes dataset's class distribution affect the logistic regression model?

    The diabetic class (268) was much smaller than non-diabetic (500), leading to low recall for diabetic class (55%).

  56. What is the role of the score() function in sklearn for logistic regression?

    It returns the mean accuracy (proportion of correct predictions) on the given test data.

  57. What is the main takeaway about data preparation in data science?

    Around 80% of project effort goes into data preparation; it is more critical than algorithm selection.

Card 1 of 57
Card 1 of 57

Ask anything

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

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent