Regression models are used to predict values. What is the main reason regression predicts continuous values instead of categories?
Think about what kind of output a line or curve can produce.
Regression predicts continuous values because it models the relationship between inputs and outputs as a function that can take any real number, not just fixed categories.
What is the output of this code predicting a value using a simple linear regression model?
from sklearn.linear_model import LinearRegression import numpy as np X = np.array([[1], [2], [3], [4]]) y = np.array([2, 4, 6, 8]) model = LinearRegression().fit(X, y) prediction = model.predict(np.array([[5]])) print(prediction[0])
The model fits y = 2 * x. What is y when x = 5?
The model learns the relationship y = 2 * x. For input 5, the output is 10.0, a continuous value.
You want to predict house prices based on features like size and location. Which model type is best suited for this task?
House prices are numbers that can vary widely, not categories.
Linear Regression is designed to predict continuous numeric values like prices, unlike classification or clustering models.
In a regression model, what is the effect of increasing the regularization strength (like alpha in Ridge regression) on the predicted continuous values?
Think about how regularization controls model complexity.
Increasing regularization strength reduces coefficient sizes, which smooths predictions and avoids overfitting extreme values.
Which metric is most appropriate to evaluate the accuracy of a regression model predicting continuous values?
Consider metrics that measure how close predicted numbers are to actual numbers.
Mean Squared Error measures the average squared difference between predicted and actual continuous values, making it ideal for regression.
