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

  • 30Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Linear Regression Fundamentals

What is the primary purpose of regression analysis?

30 questions

  1. 1

    What is the primary purpose of regression analysis?

    1. A

      To visualize data in scatter plots and histograms

    2. B

      To understand the relationship between two or more variables by creating a predictive model

    3. C

      To replace missing values in a dataset

    4. D

      To classify data points into discrete categories

    Correct answer
    B

    To understand the relationship between two or more variables by creating a predictive model

    Explanation

    Regression analysis creates a predictive model that quantifies the relationship between a dependent variable and one or more independent variables, enabling predictions and understanding of trends.

  2. 2

    In linear regression, what does the equation y=mx+cy = mx + cy=mx+c represent?

    1. A

      A sigmoid function used for classification

    2. B

      A hyperplane in multiple dimensions

    3. C

      A straight line where mmm is the slope and ccc is the intercept

    4. D

      A quadratic curve where mmm is the curvature and ccc is the vertex

    Correct answer
    C

    A straight line where mmm is the slope and ccc is the intercept

    Explanation

    In simple linear regression, the model is a straight line defined by y=mx+cy = mx + cy=mx+c, where mmm (slope) indicates the change in yyy per unit change in xxx, and ccc (intercept) is the value of yyy when x=0x = 0x=0.

  3. 3

    What is the role of the 'residual' in linear regression?

    1. A

      The slope of the best-fit line

    2. B

      The difference between the observed value and the predicted value

    3. C

      The average of all observed values

    4. D

      The coefficient of determination

    Correct answer
    B

    The difference between the observed value and the predicted value

    Explanation

    A residual is the difference between the actual observed value and the value predicted by the regression model. It measures the error for each data point.

  4. 4

    The best-fit line in linear regression is found by minimizing which quantity?

    1. A

      The mean absolute error (MAE)

    2. B

      The R-squared value

    3. C

      The total sum of squares (TSS)

    4. D

      The residual sum of squares (RSS)

    Correct answer
    D

    The residual sum of squares (RSS)

    Explanation

    The best-fit line minimizes the sum of squared residuals (RSS), which quantifies the overall discrepancy between observed and predicted values.

  5. 5

    Simple linear regression differs from multiple linear regression in that:

    1. A

      Simple linear regression is used for classification, while multiple is for regression

    2. B

      Simple linear regression requires normally distributed errors, while multiple does not

    3. C

      Simple linear regression uses one independent variable, while multiple uses two or more

    4. D

      Simple linear regression cannot have an intercept term

    Correct answer
    C

    Simple linear regression uses one independent variable, while multiple uses two or more

    Explanation

    Simple linear regression models the relationship between one dependent and one independent variable. Multiple linear regression extends this to two or more independent variables.

  6. 6

    In multiple linear regression, what does the coefficient bib_ibi​ represent when the model is y=b0+b1x1+b2x2+…y = b_0 + b_1 x_1 + b_2 x_2 + \ldotsy=b0​+b1​x1​+b2​x2​+…?

    1. A

      The correlation between xix_ixi​ and yyy

    2. B

      The probability that xix_ixi​ is a significant predictor

    3. C

      The expected change in yyy for a one-unit change in xix_ixi​, holding all other variables constant

    4. D

      The overall importance of the iii-th variable relative to the target

    Correct answer
    C

    The expected change in yyy for a one-unit change in xix_ixi​, holding all other variables constant

    Explanation

    Each coefficient bib_ibi​ indicates how much the dependent variable yyy is expected to increase (or decrease) when that independent variable increases by one unit, assuming all other predictors remain unchanged.

  7. 7

    What is the primary purpose of splitting data into training and testing sets?

    1. A

      To increase the size of the dataset for better training

    2. B

      To evaluate how well the model generalizes to new, unseen data

    3. C

      To reduce the number of features in the model

    4. D

      To ensure all data points are used for both training and testing

    Correct answer
    B

    To evaluate how well the model generalizes to new, unseen data

    Explanation

    Splitting data into training and testing sets allows us to assess model performance on data not used during training, which indicates how well the model will perform on new data and helps detect overfitting.

  8. 8

    The coefficient of determination (R2R^2R2) measures:

    1. A

      The correlation between the dependent and independent variables

    2. B

      The proportion of variance in the dependent variable explained by the independent variables

    3. C

      The slope of the regression line

    4. D

      The average error between predicted and actual values

    Correct answer
    B

    The proportion of variance in the dependent variable explained by the independent variables

    Explanation

    R2R^2R2 represents the fraction of the total variance in the dependent variable that is explained by the regression model. It ranges from 0 to 1, with higher values indicating a better fit.

  9. 9

    Adjusted R2R^2R2 is preferred over R2R^2R2 because it:

    1. A

      Is easier to interpret than R2R^2R2

    2. B

      Measures the root mean square error

    3. C

      Always increases when a new variable is added

    4. D

      Penalizes the inclusion of irrelevant independent variables

    Correct answer
    D

    Penalizes the inclusion of irrelevant independent variables

    Explanation

    Adjusted R2R^2R2 adjusts for the number of predictors in the model, increasing only if the new variable improves the model more than expected by chance. It thus discourages adding useless variables.

  10. 10

    In logistic regression, the output of the model is transformed into a probability using:

    1. A

      The linear function mx+cmx + cmx+c

    2. B

      The exponential function emx+ce^{mx + c}emx+c

    3. C

      The sigmoid function 11+e−(mx+c)\frac{1}{1 + e^{-(mx + c)}}1+e−(mx+c)1​

    4. D

      The logarithmic function ln⁡(mx+c)\ln(mx + c)ln(mx+c)

    Correct answer
    C

    The sigmoid function 11+e−(mx+c)\frac{1}{1 + e^{-(mx + c)}}1+e−(mx+c)1​

    Explanation

    Logistic regression applies the sigmoid (logistic) function to the linear combination mx+cmx + cmx+c to map any real-valued number into a probability between 0 and 1.

  11. 11

    Which cost function is commonly minimized in logistic regression?

    1. A

      Mean absolute error (MAE)

    2. B

      Residual sum of squares (RSS)

    3. C

      Log loss (cross-entropy)

    4. D

      Mean squared error (MSE)

    Correct answer
    C

    Log loss (cross-entropy)

    Explanation

    Logistic regression uses log loss (also known as cross-entropy) as the cost function because it quantifies the difference between predicted probabilities and actual binary labels more effectively than MSE.

  12. 12

    When classes are imbalanced in a classification problem, the model tends to:

    1. A

      Be biased toward the majority class

    2. B

      Perform equally well on both classes

    3. C

      Become completely random

    4. D

      Automatically adjust the decision threshold

    Correct answer
    A

    Be biased toward the majority class

    Explanation

    Most classification algorithms aim to minimize overall error, so they become biased toward the majority class. This results in poor recall for the minority class unless techniques like upsampling or threshold adjustment are applied.

  13. 13

    A confusion matrix for a binary classifier shows:

    1. A

      The correlation between predicted and actual values

    2. B

      The feature importance scores

    3. C

      The probability distribution of each class

    4. D

      The counts of true positives, true negatives, false positives, and false negatives

    Correct answer
    D

    The counts of true positives, true negatives, false positives, and false negatives

    Explanation

    A confusion matrix tabulates the performance of a classification model by comparing predicted labels to actual labels. It contains four cells: TP, TN, FP, FN.

  14. 14

    Recall (sensitivity) for a given class is calculated as:

    1. A

      TNTN+FP\frac{TN}{TN + FP}TN+FPTN​

    2. B

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

    3. C

      TPTP+FP\frac{TP}{TP + FP}TP+FPTP​

    4. D

      TPTP+FN\frac{TP}{TP + FN}TP+FNTP​

    Correct answer
    D

    TPTP+FN\frac{TP}{TP + FN}TP+FNTP​

    Explanation

    Recall is the proportion of actual positive cases that are correctly identified by the model: TPTP+FN\frac{TP}{TP + FN}TP+FNTP​.

  15. 15

    One assumption of linear regression is homoscedasticity, which means:

    1. A

      The variance of errors is constant across all levels of the independent variable

    2. B

      The errors are normally distributed

    3. C

      The relationship between X and Y is linear

    4. D

      The independent variables are uncorrelated with each other

    Correct answer
    A

    The variance of errors is constant across all levels of the independent variable

    Explanation

    Homoscedasticity assumes that the spread of residuals is roughly equal for all predicted values. Heteroscedasticity, where variance changes, can violate this assumption.

  16. 16

    Multicollinearity in multiple linear regression refers to:

    1. A

      High correlation among independent variables

    2. B

      The presence of outliers in the data

    3. C

      Non-linear relationship between variables

    4. D

      High correlation between independent and dependent variables

    Correct answer
    A

    High correlation among independent variables

    Explanation

    Multicollinearity occurs when two or more independent variables are highly correlated, making it difficult to estimate their individual effects and potentially inflating standard errors.

  17. 17

    Which of the following is NOT a typical assumption of linear regression?

    1. A

      Errors are independent of each other

    2. B

      Errors are normally distributed with mean zero

    3. C

      The dependent variable is binary

    4. D

      The relationship between predictors and target is linear

    Correct answer
    C

    The dependent variable is binary

    Explanation

    Linear regression assumes a continuous dependent variable, not binary. Binary outcomes are typically modeled with logistic regression.

  18. 18

    Outliers in the data can severely affect linear regression because:

    1. A

      Outliers always increase the R-squared value

    2. B

      Linear regression is incapable of handling any outliers

    3. C

      Outliers cause the model to overfit the training data

    4. D

      The best-fit line can be pulled toward the outliers, reducing model accuracy

    Correct answer
    D

    The best-fit line can be pulled toward the outliers, reducing model accuracy

    Explanation

    Because linear regression minimizes squared errors, extreme outliers can disproportionately influence the fitted line, leading to a model that does not represent the majority of the data well.

  19. 19

    When a variable's p-value in regression output is large (e.g., > 0.05), it suggests:

    1. A

      The variable is highly correlated with the target

    2. B

      The variable may not be a statistically significant predictor

    3. C

      The variable should be transformed into a log scale

    4. D

      The coefficient for that variable is zero

    Correct answer
    B

    The variable may not be a statistically significant predictor

    Explanation

    A large p-value (typically above 0.05) indicates that the observed relationship between the predictor and target could reasonably occur by chance, so the variable is not statistically significant at that confidence level.

  20. 20

    What is the purpose of using gradient descent in linear regression?

    1. A

      To compute the p-values of the coefficients

    2. B

      To select the most important features

    3. C

      To iteratively find the coefficients that minimize the cost function

    4. D

      To normalize the data before modeling

    Correct answer
    C

    To iteratively find the coefficients that minimize the cost function

    Explanation

    Gradient descent is an optimization algorithm that updates the model parameters (coefficients) repeatedly to reduce the cost function (e.g., RSS), eventually finding a minimum.

  21. 21

    In the context of regression, what does 'overfitting' mean?

    1. A

      The model performs well on training data but poorly on new data

    2. B

      The model has too few parameters to capture the data pattern

    3. C

      The model assumes linearity when the relationship is non-linear

    4. D

      The model's residuals are normally distributed

    Correct answer
    A

    The model performs well on training data but poorly on new data

    Explanation

    Overfitting occurs when a model learns the training data too closely, including noise, and fails to generalize to unseen data, leading to high variance.

  22. 22

    When examining a pair plot, what does it indicate if the density plots of two classes for a feature heavily overlap with similar central values?

    1. A

      That feature is likely a poor predictor for distinguishing the classes

    2. B

      The data contains many outliers

    3. C

      That feature is the most important for classification

    4. D

      The feature should be transformed using a log function

    Correct answer
    A

    That feature is likely a poor predictor for distinguishing the classes

    Explanation

    If the distributions of a feature for different classes are nearly identical, that feature provides little discriminatory power. It is unlikely to improve classification accuracy.

  23. 23

    Missing values in a numerical column are often imputed with the median rather than the mean because:

    1. A

      The median is easier to compute

    2. B

      The median is less sensitive to outliers

    3. C

      The median maintains the original distribution shape

    4. D

      The mean always remains the same after imputation

    Correct answer
    B

    The median is less sensitive to outliers

    Explanation

    The median is robust to outliers, while the mean can be heavily influenced by extreme values. Using the median for imputation reduces the risk of distorting the central tendency.

  24. 24

    A low variance filter in feature selection removes columns that:

    1. A

      Contain only numerical data

    2. B

      Have very little variation in their values, thus providing limited information

    3. C

      Have a high number of missing values

    4. D

      Are highly correlated with the target variable

    Correct answer
    B

    Have very little variation in their values, thus providing limited information

    Explanation

    Columns with near-zero variance (e.g., constant values or extremely imbalanced categories) are unlikely to be useful predictors and can be removed to simplify the model.

  25. 25

    In linear regression, what is the implication if the residual plot shows a clear pattern (e.g., a curve)?

    1. A

      The model fits the data perfectly

    2. B

      The R-squared value will be close to 1

    3. C

      The relationship may be non-linear, and a linear model might not be appropriate

    4. D

      The errors are homoscedastic

    Correct answer
    C

    The relationship may be non-linear, and a linear model might not be appropriate

    Explanation

    A pattern in the residual plot (e.g., systematic increase or decrease) suggests that the linear model is not capturing the true relationship; non-linear terms or transformations may be needed.

  26. 26

    Which of the following is an advantage of logistic regression?

    1. A

      It does not require any data preprocessing

    2. B

      It assumes normally distributed independent variables

    3. C

      It is highly effective for non-linear decision boundaries

    4. D

      It can output probabilities for class membership

    Correct answer
    D

    It can output probabilities for class membership

    Explanation

    Logistic regression provides probability estimates (via the sigmoid function) for each class, which can be thresholded to make hard classifications. This probabilistic output is valuable for risk assessment.

  27. 27

    What does the term 'linear' in linear regression refer to?

    1. A

      The relationship between the dependent and independent variables must be linear

    2. B

      The model uses only one independent variable

    3. C

      The errors are linearly distributed

    4. D

      The model is linear in the coefficients, not necessarily in the variables

    Correct answer
    D

    The model is linear in the coefficients, not necessarily in the variables

    Explanation

    Linear regression is 'linear' because the predicted value is a linear combination of the model parameters (coefficients). The predictor variables themselves can be transformed (e.g., x2x^2x2, log⁡x\log xlogx), as long as the coefficients are not raised to powers or multiplied together.

  28. 28

    When using the train_test_split function from scikit-learn, what does the parameter test_size=0.3 indicate?

    1. A

      30% of the features will be used for testing

    2. B

      The test set will contain 30 observations

    3. C

      30% of the data will be used for training and 70% for testing

    4. D

      30% of the data will be used for testing and 70% for training

    Correct answer
    D

    30% of the data will be used for testing and 70% for training

    Explanation

    test_size specifies the proportion of the dataset to include in the test split. Here, 30% of the data is reserved for testing, and the remaining 70% is used for training.

  29. 29

    In scikit-learn, after fitting a linear regression model, how can you obtain the coefficients?

    1. A

      Using the .score() method

    2. B

      Using the .predict() method on the test data

    3. C

      Using the .intercept_ attribute

    4. D

      Using the .coef_ attribute of the fitted model

    Correct answer
    D

    Using the .coef_ attribute of the fitted model

    Explanation

    The fitted linear regression model stores its coefficients (slopes) in the .coef_ attribute and the intercept in .intercept_. For multiple regression, .coef_ is an array of coefficients.

  30. 30

    What is the main difference between linear regression and logistic regression regarding the dependent variable?

    1. A

      There is no difference; both can be used interchangeably

    2. B

      Logistic regression uses least squares; linear regression uses maximum likelihood

    3. C

      Linear regression requires a continuous dependent variable; logistic regression requires a categorical dependent variable

    4. D

      Linear regression can only handle one independent variable; logistic regression can handle many

    Correct answer
    C

    Linear regression requires a continuous dependent variable; logistic regression requires a categorical dependent variable

    Explanation

    Linear regression is used when the outcome is continuous (e.g., price, weight). Logistic regression is used for classification where the outcome is categorical (usually binary).

Question 1 of 30
Question 1 of 30

Ask anything

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

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent