Multiple linear regression is a method to predict a number by using two or more input features. It finds a straight line (or plane) that best fits the data points in multiple dimensions.
Click to reveal answer
beginner
Write the general formula for multiple linear regression.
The formula is: y = b0 + b1*x1 + b2*x2 + ... + bn*xn + e, where y is the predicted value, b0 is the intercept, b1 to bn are coefficients, x1 to xn are input features, and e is the error term.
Click to reveal answer
beginner
Why do we use multiple linear regression instead of simple linear regression?
Because multiple linear regression can use many features to make better predictions, while simple linear regression uses only one feature. This helps capture more information from the data.
Click to reveal answer
intermediate
What does the coefficient (like b1) represent in multiple linear regression?
Each coefficient shows how much the predicted value changes when that feature increases by one unit, keeping other features constant.
Click to reveal answer
intermediate
How do we measure how well a multiple linear regression model fits the data?
We use metrics like R-squared, which tells us the percentage of variation in the target explained by the features, and Mean Squared Error (MSE), which measures average prediction error.
Click to reveal answer
What does the intercept (b0) in multiple linear regression represent?
AThe predicted value when all features are zero
BThe slope of the first feature
CThe error term
DThe average of all features
✗ Incorrect
The intercept is the predicted output when all input features are zero.
Which metric tells how much of the target's variation is explained by the model?
AMean Squared Error
BPrecision
CAccuracy
DR-squared
✗ Incorrect
R-squared shows the proportion of variance in the target explained by the features.
If a coefficient b2 is negative, what does it mean?
AFeature 2 has no effect
BAs feature 2 increases, the predicted value decreases
CFeature 2 is the most important
DThe model is wrong
✗ Incorrect
A negative coefficient means the predicted value goes down when that feature goes up.
Multiple linear regression can be used when:
AThere are multiple input features
BThere is only one input feature
CThe target is categorical
DThe data is images
✗ Incorrect
Multiple linear regression uses two or more input features to predict a continuous target.
What is the error term (e) in the regression formula?
AThe sum of all features
BThe predicted value
CThe difference between actual and predicted values
DThe intercept
✗ Incorrect
The error term represents the difference between the actual and predicted values.
Explain how multiple linear regression uses features to make predictions.
Think about how each feature contributes to the final predicted value.
You got /4 concepts.
Describe two ways to evaluate the performance of a multiple linear regression model.
One metric shows explained variance, the other shows average error.
You got /4 concepts.
Practice
(1/5)
1. What does multiple linear regression do in simple terms?
easy
A. It predicts a result using several input features combined.
B. It groups data into clusters based on similarity.
C. It reduces the number of features by combining them.
D. It finds the shortest path between two points.
Solution
Step 1: Understand the purpose of multiple linear regression
Multiple linear regression uses multiple inputs to predict a single output by finding the best weights for each input.
Step 2: Compare options with this understanding
Only It predicts a result using several input features combined. correctly describes predicting a result using several inputs combined.
Final Answer:
It predicts a result using several input features combined. -> Option A
Quick Check:
Multiple inputs predict output = A [OK]
Hint: Remember: multiple inputs, one output prediction [OK]
Common Mistakes:
Confusing regression with clustering
Thinking it reduces features instead of weighting them
Mixing it up with pathfinding algorithms
2. Which of the following is the correct formula for multiple linear regression prediction?
easy
A. y = w0 + w1*x1 + w2*x2 + ... + wn*xn
B. y = w0 * x1 + w1 * x2 + ... + wn * xn
C. y = w0 / x1 + w1 / x2 + ... + wn / xn
D. y = w0 - w1*x1 - w2*x2 - ... - wn*xn
Solution
Step 1: Recall the multiple linear regression formula
The prediction is a sum of a bias term plus each input multiplied by its weight: y = w0 + w1*x1 + w2*x2 + ... + wn*xn.
Step 2: Check each option against the formula
Only y = w0 + w1*x1 + w2*x2 + ... + wn*xn matches the correct formula with addition and multiplication.
Final Answer:
y = w0 + w1*x1 + w2*x2 + ... + wn*xn -> Option A
Quick Check:
Sum of weighted inputs plus bias = B [OK]
Hint: Sum weighted inputs plus bias for prediction [OK]
Common Mistakes:
Using multiplication instead of addition between terms
Dividing weights by inputs
Subtracting weights instead of adding
3. Given weights w0=2, w1=3, w2=-1 and inputs x1=4, x2=5, what is the predicted value y using multiple linear regression?
D. The term w2 + x2 should be w2 * x2 for correct multiplication.
Solution
Step 1: Analyze the formula inside the function
The formula should multiply each input by its weight: w0 + w1*x1 + w2*x2.
Step 2: Identify the mistake in the code
The code uses w2 + x2 instead of w2 * x2, which adds instead of multiplies.
Final Answer:
The term w2 + x2 should be w2 * x2 for correct multiplication. -> Option D
Quick Check:
Multiplication needed, not addition = A [OK]
Hint: Check all input-weight pairs use multiplication [OK]
Common Mistakes:
Using + instead of * between weight and input
Forgetting return statement (not here though)
Mixing parameter order
Incorrect print syntax
5. You have a dataset with features: hours studied (x1), hours slept (x2), and exam score (y). You fit a multiple linear regression model and get weights: w0=5, w1=4, w2=2. What does the weight w1=4 tell you about hours studied?
hard
A. Hours slept affects exam score more than hours studied.
B. Hours studied has no effect on exam score.
C. For each extra hour studied, exam score increases by 4 points, holding sleep constant.
D. Exam score decreases by 4 points for each hour studied.
Solution
Step 1: Understand the meaning of weights in multiple linear regression
Each weight shows how much the output changes when that input increases by one unit, keeping others fixed.
Step 2: Interpret w1=4 for hours studied
A weight of 4 means exam score increases by 4 points for each additional hour studied, assuming hours slept stays the same.
Final Answer:
For each extra hour studied, exam score increases by 4 points, holding sleep constant. -> Option C
Quick Check:
Weight shows effect per unit input = D [OK]
Hint: Weight = change in output per unit input [OK]
Common Mistakes:
Thinking weight means no effect
Confusing positive and negative effect
Mixing effects of different features
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.