Bias is the error from wrong assumptions in the learning algorithm. It causes the model to miss relevant relations between features and target outputs, leading to underfitting.
Click to reveal answer
beginner
What does variance mean in the context of machine learning models?
Variance is the error from sensitivity to small fluctuations in the training set. High variance means the model learns noise as if it were true patterns, causing overfitting.
Click to reveal answer
beginner
Explain the bias-variance tradeoff in simple terms.
The bias-variance tradeoff is balancing two types of errors: too simple models have high bias and miss patterns, too complex models have high variance and learn noise. The goal is to find a model that balances both for best predictions.
Click to reveal answer
intermediate
How does increasing model complexity affect bias and variance?
Increasing model complexity usually decreases bias because the model can fit the training data better, but it increases variance because the model may fit noise and not generalize well.
Click to reveal answer
intermediate
What is a practical way to detect if a model is suffering from high bias or high variance?
Check training and validation errors: high training and validation errors suggest high bias (underfitting), while low training error but high validation error suggests high variance (overfitting).
Click to reveal answer
What does high bias usually cause in a machine learning model?
AUnderfitting
BOverfitting
CPerfect fit
DRandom predictions
✗ Incorrect
High bias means the model is too simple and misses important patterns, causing underfitting.
Which of the following is a sign of high variance?
ALow training error and high validation error
BHigh training error and high validation error
CLow training and validation errors
DHigh bias
✗ Incorrect
High variance models fit training data well (low training error) but fail to generalize (high validation error).
What happens to bias and variance when you increase model complexity?
ABoth bias and variance increase
BBias increases, variance decreases
CBias decreases, variance increases
DBoth bias and variance decrease
✗ Incorrect
More complex models fit training data better (lower bias) but can capture noise (higher variance).
Why is the bias-variance tradeoff important?
ATo always choose the simplest model
BTo find a model that balances underfitting and overfitting
CTo ignore training errors
DTo maximize variance
✗ Incorrect
Balancing bias and variance helps build models that generalize well to new data.
Which error type is caused by a model that is too simple?
AVariance error
BRandom error
CNoise error
DBias error
✗ Incorrect
Simple models have high bias, missing important patterns.
Describe the bias-variance tradeoff and why it matters in machine learning.
Think about how simple and complex models behave differently.
You got /4 concepts.
How can you tell if a model is overfitting or underfitting by looking at training and validation errors?
Compare errors on training data versus new data.
You got /2 concepts.
Practice
(1/5)
1. What does high bias in a machine learning model usually indicate?
easy
A. The model is too complex and overfits noise
B. The model fits the training data perfectly
C. The model is too simple and misses important patterns
D. The model has low training error but high test error
Solution
Step 1: Understand bias in model context
Bias refers to error from overly simple models that cannot capture the true patterns in data.
Step 2: Match bias description to options
The model is too simple and misses important patterns correctly describes high bias as a simple model missing important patterns.
Final Answer:
The model is too simple and misses important patterns -> Option C
Quick Check:
High bias = Simple model misses patterns [OK]
Hint: High bias means model is too simple, misses patterns [OK]
Common Mistakes:
Confusing bias with variance
Thinking high bias means overfitting
Mixing training and test error concepts
2. Which of the following statements about variance is correct?
easy
A. Variance measures error from models that are too simple
B. Variance decreases when model complexity increases
C. Variance is unrelated to model complexity
D. Variance is error caused by fitting noise in training data
Solution
Step 1: Define variance in machine learning
Variance is the error caused by a model fitting noise or random fluctuations in training data.
Step 2: Identify correct statement
Variance is error caused by fitting noise in training data correctly states variance is error from fitting noise in training data.
Final Answer:
Variance is error caused by fitting noise in training data -> Option D
Quick Check:
Variance = Overfitting noise [OK]
Hint: Variance means model fits noise, causing overfitting [OK]
Common Mistakes:
Confusing variance with bias
Thinking variance decreases with complexity
Ignoring noise fitting in variance
3. Consider this Python code simulating model error components:
import numpy as np
np.random.seed(0)
true_pattern = 5
model_predictions = [4, 5, 6, 7, 8]
noise = np.random.normal(0, 1, 5)
errors = [(pred - true_pattern + n) ** 2 for pred, n in zip(model_predictions, noise)]
print(round(np.mean(errors), 2))
Hint: Trace with seed(0): (bias + noise)^2 mean rounds to 9.27 [OK]
Common Mistakes:
Ignoring noise in error calculation
Not squaring the error terms
Rounding errors too early
4. The following code tries to illustrate bias and variance but has a mistake:
import numpy as np
np.random.seed(1)
true_value = 10
predictions = [true_value + np.random.normal(0, 5) for _ in range(5)]
bias = np.mean(predictions) - true_value
variance = np.var(predictions)
print(f"Bias: {bias:.2f}, Variance: {variance:.2f}")
What is the error in this code?
medium
A. Bias should be absolute difference, not signed
B. Variance calculation should use ddof=1 for sample variance
C. Random seed is set incorrectly
D. Predictions should not include noise for bias calculation
Solution
Step 1: Understand variance calculation
By default, np.var uses population variance (ddof=0). For sample variance, ddof=1 should be used to get an unbiased estimate.
Step 2: Identify mistake in code
The code uses np.var(predictions) without ddof=1, so variance is underestimated for small samples.
Final Answer:
Variance calculation should use ddof=1 for sample variance -> Option B
Quick Check:
Use ddof=1 for unbiased variance estimate [OK]
Hint: Use ddof=1 in np.var for sample variance [OK]
Common Mistakes:
Ignoring ddof parameter in variance
Confusing bias sign with absolute error
Thinking seed affects bias/variance calculation
5. You have a dataset with 1000 samples. You train two models:
Model A: Simple linear regression
Model B: Deep neural network with many layers
Model A has high training error and low variance. Model B has low training error but high variance. Which strategy best balances the bias-variance tradeoff to improve test accuracy?
hard
A. Use Model B and increase training data or apply regularization
B. Use Model A and add more features to reduce bias
C. Use Model B without changes to maximize complexity
D. Use Model A and reduce training data to lower variance
Solution
Step 1: Analyze model characteristics
Model A is simple with high bias (high training error) and low variance. Model B is complex with low bias but high variance (overfitting).
Step 2: Choose strategy to balance bias and variance
To reduce variance in Model B, increase training data or apply regularization. This keeps low bias but controls overfitting.
Final Answer:
Use Model B and increase training data or apply regularization -> Option A
Quick Check:
Reduce variance by more data or regularization [OK]
Hint: Fix high variance with more data or regularization [OK]
Common Mistakes:
Adding features to reduce variance instead of bias
Reducing data to lower variance (actually increases variance)
Ignoring regularization benefits
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.