Linear Regression Basics QUIZS
Linear Regression Basics QUIZS
11. Which metric is used to evaluate the goodness of fit for linear regression?
o a) Accuracy
o b) R-squared (R²)
o c) F1-score
o d) Mean Squared Error (MSE)
12. What does an R-squared (R²) value of 0.90 mean?
o a) 90% of the variance in the dependent variable is explained by the
independent variables
o b) 90% of the model’s predictions are correct
o c) 90% of the independent variable is explained by the dependent variable
o d) The model is underfitting
13. Which of these is a limitation of R-squared as a performance metric?
o a) It increases with more predictors, even if they are irrelevant
o b) It is invariant to the number of predictors
o c) It measures the correlation between independent variables
o d) It cannot be used with nonlinear data
14. What does the Mean Squared Error (MSE) measure in linear regression?
o a) The average squared difference between actual and predicted values
o b) The variance of the residuals
o c) The goodness of fit of the model
o d) The correlation between features
15. What does a p-value in a linear regression model indicate?
o a) The strength of the relationship between variables
o b) The likelihood that a particular coefficient is significantly different from
zero
o c) The percentage of variance explained by the model
o d) The accuracy of the model
Correlation and Its Role in Linear Regression
16. What is the Pearson correlation coefficient used for in linear regression?
o a) To determine the strength and direction of the relationship between two
variables
o b) To assess the residuals of the model
o c) To calculate the intercept in the model
o d) To compute the mean squared error
17. If the Pearson correlation coefficient between two variables is 0.85, what can we
infer?
o a) A strong positive linear relationship
o b) A weak negative relationship
o c) No relationship
o d) A strong negative relationship
18. Which value of the Pearson correlation coefficient indicates no linear
relationship?
o a) 0
o b) 0.5
o c) 1
o d) -1
19. What does a correlation of 0.98 between two variables suggest?
o a) A very strong negative relationship
o b) A very strong positive linear relationship
o c) No relationship
o d) The data is highly biased
20. Can correlation be used to prove causation in linear regression?
o a) Yes, correlation always proves causation
o b) No, correlation does not imply causation
o c) Yes, correlation shows cause-and-effect relationships
o d) No, linear regression does not consider correlation
26. What is the difference between simple and multiple linear regression?
o a) Simple regression uses one independent variable, while multiple regression
uses more than one
o b) Simple regression uses no intercept, while multiple regression does
o c) Simple regression is used for categorical variables, and multiple regression
is for continuous variables
o d) Simple regression uses regularization, and multiple does not
27. What does it mean if a linear regression model suffers from overfitting?
o a) The model is too simple and underfitting the data
o b) The model performs poorly on both the training and test data
o c) The model fits the training data too well and generalizes poorly to new data
o d) The model has an optimal level of complexity
28. What is regularization in the context of linear regression?
o a) Adding constraints to the regression coefficients to prevent overfitting
o b) Increasing the complexity of the model
o c) Removing irrelevant features
o d) Reducing the training data size
29. Which of the following is a regularization technique used in linear regression?
o a) Gradient descent
o b) L1 regularization (Lasso)
o c) Cross-validation
o d) Decision trees
30. What does Lasso regularization do?
o a) It increases the coefficients of important features and reduces the
coefficients of less important ones
o b) It decreases the coefficients of all features
Below is a 50-question quiz on Linear Regression in the context of Artificial Intelligence and
Machine Learning. These questions range from basic to intermediate concepts related to the
linear regression algorithm.
Linear Regression Quiz
4. In simple linear regression, what do mmm and bbb represent in the equation
y=mx+by = mx + by=mx+b?
a) mmm is the intercept and bbb is the slope
b) mmm is the slope and bbb is the intercept
c) mmm is the coefficient and bbb is the error term
d) mmm and bbb are both coefficients
7. Which of the following is true about the relationship between the dependent and
independent variables in linear regression?
a) The independent variable is predicted from the dependent variable
b) The dependent variable is predicted from the independent variable
c) There is no relationship between the two
d) Both variables are equally dependent on each other
8. What assumption does linear regression make about the residuals (errors)?
a) The errors are normally distributed
b) The errors are exponentially distributed
c) The errors follow a uniform distribution
d) The errors follow a Poisson distribution
13. In multiple linear regression, what is the goal of finding the coefficients?
a) To predict the response variable
b) To minimize the number of features
c) To optimize the cost function
d) To maximize the value of the dependent variable
15. What does it mean if the p-value of a coefficient is less than 0.05 in linear regression?
a) The coefficient is statistically significant
b) The coefficient is irrelevant
c) The residuals are non-normal
d) The model is overfitting
17. What is the gradient descent algorithm used for in linear regression?
a) To find the values of the model parameters (coefficients)
b) To optimize the number of features
c) To calculate the R-squared value
d) To find the line of best fit using the least squares method
20. What does the coefficient of determination (R²) represent in a linear regression
model?
a) The amount of variance explained by the model
b) The standard deviation of residuals
c) The slope of the regression line
d) The variance of the independent variables
23. In linear regression, which of the following methods is used to calculate the optimal
coefficients?
a) Cross-validation
b) Backpropagation
c) Least squares estimation
d) Random search
26. What is the main difference between simple and multiple linear regression?
a) Simple regression involves multiple dependent variables
b) Multiple regression uses more than one independent variable
c) Simple regression is used for classification problems
d) Multiple regression does not use a linear relationship
27. Which of the following is true about the assumptions of linear regression?
a) The independent variables must be independent of each other
b) The dependent variable must have a normal distribution
c) The residuals must be normally distributed
d) All of the above
28. In linear regression, how do you interpret the intercept term (bbb)?
a) It is the slope of the regression line
b) It is the predicted value when all independent variables are zero
c) It is the error term in the model
d) It is the average of the dependent variable
29. What is the effect of adding more irrelevant features to a linear regression model?
a) The model will become more interpretable
b) The model may overfit the data
c) The model’s accuracy will improve significantly
d) It will reduce the complexity of the model
30. In multiple linear regression, what does the term "interaction term" refer to?
a) The product of two or more independent variables
b) The dependent variable
c) The residual errors
d) The sum of all independent variables
31. Which algorithm is typically used when linear regression cannot be applied due to
non-linearity?
a) Support Vector Machines (SVM)
b) Decision Trees
c) Polynomial Regression
d) K-Means Clustering
33. In linear regression, what is the purpose of regularization techniques like Lasso or
Ridge?
a) To increase the model's complexity
b) To prevent overfitting by penalizing large coefficients
c) To increase the speed of model training
d) To decrease the number of features in the model
35. How do you know if a linear regression model is appropriate for a dataset?
a) Check if the residuals are randomly distributed
b) Check if the independent variables are uncorrelated
c) Check if the data follows a Gaussian distribution
d) All of the above
36. What does 'shrinkage' refer to in regularization methods for linear regression?
a) The reduction in the magnitude of the coefficients
b) The reduction in the number of features
c) The reduction in the variance of the dependent variable
d) The reduction in the residual sum of squares
38. Which of the following is a common metric for evaluating the performance of a
linear regression model?
a) Accuracy
b) Mean Squared Error (MSE)
c) F1-score
d) Precision
39. What happens when the learning rate is too high during gradient descent in linear
regression?
a) The model will converge too quickly
b) The model may overshoot the optimal solution
c) The model will become more accurate
d) The model will converge to the global minimum faster
40. What is a key feature of polynomial regression?
a) It uses multiple linear regression models simultaneously
b) It models non-linear relationships by adding polynomial terms to the input features
c) It only works with binary data
d) It is a type of logistic regression
41. Which of the following can indicate a poor fit in linear regression?
a) A low R-squared value
b) A high p-value for the coefficient
c) Non-random residuals
d) All of the above
42. What is the primary advantage of linear regression over more complex algorithms?
a) It is computationally expensive
b) It is easier to interpret and understand
c) It works well for non-linear data
d) It automatically handles missing data
44. What is the difference between "slope" and "intercept" in a linear regression
equation?
a) The slope represents the predicted value when the independent variable is zero, while the
intercept is the change in the dependent variable for a unit change in the independent variable
b) The intercept represents the predicted value when the independent variable is zero, while
the slope represents the change in the dependent variable for a unit change in the independent
variable
c) Both terms are interchangeable
d) The intercept is a constant value, and the slope varies
49. What is the most commonly used loss function in linear regression?
a) Mean Absolute Error (MAE)
b) Mean Squared Error (MSE)
c) Hinge loss
d) Cross-entropy loss
50. In the context of linear regression, what is the gradient of the cost function?
a) The slope of the regression line
b) The derivative of the cost function with respect to the coefficients
c) The predicted value
d) The correlation between variables
Basic Questions
Advanced Questions
7. Regularization:
o Problem: You have a linear regression model with many features, and you
suspect overfitting due to the large number of predictors.
o Question: Explain the concepts of L1 (Lasso) and L2 (Ridge) regularization.
How do they modify the linear regression objective function, and how do they
help in reducing overfitting?
8. Polynomial Regression:
o Problem: Your dataset shows a nonlinear relationship between the input
features and the target variable, and linear regression does not provide good
results.
o Question: How can you modify your linear regression model to handle
nonlinear relationships? Explain polynomial regression and how you would
apply it in this case.
9. Bias-Variance Tradeoff:
o Problem: You are comparing the performance of a simple linear regression
model and a more complex polynomial regression model.
o Question: How does the bias-variance tradeoff affect the performance of these
models? In which scenario would you prefer a simpler model over a more
complex one?
10. Evaluation Metrics for Linear Regression:
o Problem: After fitting a linear regression model, you want to evaluate its
performance on a test set.
o Question: What are some common metrics used to evaluate the performance
of a linear regression model? How do metrics like Mean Squared Error (MSE),
R-squared, and Adjusted R-squared differ, and how should they be interpreted?
11. Gradient Descent for Linear Regression:
o Problem: You are implementing linear regression from scratch using gradient
descent.
o Question: What is the role of the learning rate in gradient descent? What
might happen if the learning rate is too high or too low? How do you
determine the optimal learning rate?
12. Outliers and Linear Regression:
o Problem: You notice that a few outliers are significantly influencing the fit of
your linear regression model.
o Question: How do outliers affect linear regression? What techniques can be
used to detect and handle outliers in regression problems?
13. Data Preprocessing for Linear Regression:
o Problem: You are working with a dataset that includes categorical variables,
missing values, and features with different scales.
o Question: What preprocessing steps would you take before fitting a linear
regression model? How would you handle categorical data, missing values,
and feature scaling?
14. Linear Regression and Feature Selection:
o Problem: You have a large number of features, some of which may not be
important for predicting the target variable.
o Question: How would you perform feature selection in linear regression?
What methods can you use to identify and remove irrelevant features?