What is the primary goal of linear regression?
B
To find the best fit line that predicts a continuous outcome
C
To cluster similar items
D
To calculate percentiles
Analysis & Theory
Linear regression is used to model the relationship between variables and predict continuous values.
What is the equation for a simple linear regression line?
Analysis & Theory
In simple linear regression, the model is typically written as `y = mx + b` (or `y = w*x + b`).
In the linear regression equation `y = mx + b`, what does 'm' represent?
C
The slope (coefficient)
Analysis & Theory
'm' (or `w`) is the slope of the line, showing how much y changes for each unit of x.
Which metric is commonly used to evaluate a linear regression model?
C
Mean Squared Error (MSE)
Analysis & Theory
MSE measures the average squared difference between actual and predicted values in regression models.
What does a high R² (R-squared) value indicate?
B
Strong linear relationship between input and output
D
Random noise in the data
Analysis & Theory
R² indicates how much of the variance in the target variable is explained by the model.
Which of the following is a key assumption of linear regression?
A
Data must be categorical
B
The relationship between variables is linear
C
Features must be normalized
D
The dataset must be balanced
Analysis & Theory
Linear regression assumes a linear relationship between independent and dependent variables.
What is multicollinearity in linear regression?
A
Multiple models are used
B
Independent variables are highly correlated
C
Dependent variables are strings
D
The model has multiple outputs
Analysis & Theory
Multicollinearity occurs when independent variables are highly correlated, which can distort the model.
Which library is commonly used in Python for linear regression?
Analysis & Theory
`sklearn.linear_model.LinearRegression` is a common tool for building linear regression models in Python.
What is the purpose of the intercept (b) in a regression model?
B
It defines the slope of the line
C
It is the predicted value when all input features are zero
Analysis & Theory
The intercept is the y-value when x is 0 — the point where the line crosses the y-axis.
Which situation best fits the use of linear regression?
A
Predicting the category of an image
B
Predicting house prices based on area and rooms
D
Detecting anomalies in networks
Analysis & Theory
House pricing is a regression problem, making linear regression suitable for continuous value prediction.