Challenge - 5 Problems
Polynomial Regression Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate1:30remaining
Understanding Polynomial Regression Degree
Which statement best describes the role of the degree in polynomial regression?
Attempts:
2 left
❓ Predict Output
intermediate1:30remaining
Output of Polynomial Feature Transformation
What is the output of the following code snippet?
ML Python
from sklearn.preprocessing import PolynomialFeatures import numpy as np X = np.array([[2]]) poly = PolynomialFeatures(degree=3, include_bias=False) result = poly.fit_transform(X) print(result)
Attempts:
2 left
❓ Hyperparameter
advanced2:00remaining
Choosing Degree to Avoid Overfitting
You have a dataset with noisy data points. Which degree choice for polynomial regression is most likely to avoid overfitting?
Attempts:
2 left
❓ Metrics
advanced1:30remaining
Interpreting Polynomial Regression Metrics
After training a polynomial regression model, you get these metrics on test data: Mean Squared Error (MSE) = 0.02, R² = 0.95. What does this tell you?
Attempts:
2 left
🔧 Debug
expert2:30remaining
Debugging Polynomial Regression Prediction Error
Consider this code snippet for polynomial regression prediction. What is the main reason the predictions are all zeros?
ML Python
from sklearn.linear_model import LinearRegression from sklearn.preprocessing import PolynomialFeatures import numpy as np X_train = np.array([[1], [2], [3], [4]]) y_train = np.array([1, 4, 9, 16]) poly = PolynomialFeatures(degree=2) X_poly = poly.fit_transform(X_train) model = LinearRegression() model.fit(X_train, y_train) X_test = np.array([[5], [6]]) X_test_poly = poly.transform(X_test) predictions = model.predict(X_test_poly) print(predictions)
Attempts:
2 left