1In the context of supervised learning, what distinguishes a regression problem from a classification problem?
A.The target variable is continuous.
B.The input features must be categorical.
C.The target variable is categorical.
D.Regression requires unsupervised data.
Correct Answer: The target variable is continuous.
Explanation:
Regression models predict a continuous target variable (e.g., house prices, temperature), whereas classification models predict categorical class labels.
Incorrect! Try again.
2Which visualization tool is most commonly used in Exploratory Data Analysis (EDA) to visualize the linear relationship between a single feature and the target variable?
A.Box plot
B.Pie chart
C.Scatter plot
D.Histogram
Correct Answer: Scatter plot
Explanation:
A scatter plot maps one variable on the x-axis and the other on the y-axis, making it ideal for visualizing the correlation and relationship between two continuous variables.
Incorrect! Try again.
3When analyzing the relationship between multiple variables in a dataset, which matrix helps quantify the linear correlation between every pair of features?
A.Correlation matrix
B.Covariance matrix
C.Hessian matrix
D.Confusion matrix
Correct Answer: Correlation matrix
Explanation:
A correlation matrix shows the correlation coefficients between variables, measuring the strength and direction of linear relationships. It is often visualized as a heatmap.
Incorrect! Try again.
4In a simple linear regression model , what does represent?
A.The learning rate
B.The slope of the line
C.The y-intercept
D.The residual error
Correct Answer: The y-intercept
Explanation:
(often denoted as or ) is the bias term or y-intercept, representing the predicted value of when is 0.
Incorrect! Try again.
5Which Scikit-Learn class is used to perform Ordinary Least Squares (OLS) linear regression?
sklearn.linear_model.LinearRegression fits a linear model with coefficients to minimize the residual sum of squares between the observed targets and predicted targets.
Incorrect! Try again.
6What is the objective function that Ordinary Least Squares (OLS) minimizes?
A.Cross-Entropy Loss
B.Sum of Squared Errors (SSE)
C.Mean Absolute Error (MAE)
D.Hinge Loss
Correct Answer: Sum of Squared Errors (SSE)
Explanation:
OLS minimizes the Sum of Squared Errors (SSE), also known as Residual Sum of Squares (RSS), defined as .
Incorrect! Try again.
7What is the primary motivation for using the RANSAC (RANdom SAmple Consensus) algorithm in regression?
A.To increase the speed of training.
B.To perform feature selection.
C.To fit a model in the presence of a significant number of outliers.
D.To handle missing values automatically.
Correct Answer: To fit a model in the presence of a significant number of outliers.
Explanation:
RANSAC fits a model to a subset of the data (inliers) and ignores data points that deviate significantly (outliers), making it robust to noisy data.
Incorrect! Try again.
8In the RANSAC algorithm, what does the 'residual_threshold' parameter define?
A.The learning rate of the estimator.
B.The maximum residual for a data sample to be classified as an inlier.
C.The minimum number of samples required to fit the model.
D.The maximum number of iterations.
Correct Answer: The maximum residual for a data sample to be classified as an inlier.
Explanation:
The residual_threshold sets the limit; data points with prediction errors (residuals) smaller than this threshold are considered inliers.
Incorrect! Try again.
9Which metric is calculated as ?
A.Mean Absolute Error
B.Coefficient of Determination
C.Mean Squared Error
D.Explained Variance Score
Correct Answer: Coefficient of Determination
Explanation:
This is the formula for the Coefficient of Determination ( score), which represents the proportion of variance in the dependent variable explained by the independent variables.
Incorrect! Try again.
10If an score is 1.0, what does this indicate about the regression model?
A.The model is a constant line.
B.The model perfectly fits the data.
C.The model explains none of the variability of the response data.
D.The model is underfitting.
Correct Answer: The model perfectly fits the data.
Explanation:
An score of 1.0 means the model's predictions exactly match the observed values ().
Incorrect! Try again.
11Why is Mean Squared Error (MSE) often preferred over Mean Absolute Error (MAE) for optimization?
A.MSE has the same unit as the target variable.
B.MSE is always smaller than MAE.
C.MSE is robust to outliers.
D.MSE is differentiable everywhere, making gradient-based optimization easier.
Correct Answer: MSE is differentiable everywhere, making gradient-based optimization easier.
Explanation:
The squaring function in MSE is smooth and convex, making it differentiable everywhere, which simplifies derivative calculation for Gradient Descent. MAE is not differentiable at 0.
Incorrect! Try again.
12To perform Polynomial Regression using a linear model in Scikit-Learn, which transformer must be applied first?
A.OneHotEncoder
B.StandardScaler
C.PolynomialFeatures
D.SimpleImputer
Correct Answer: PolynomialFeatures
Explanation:
PolynomialFeatures generates a new feature matrix consisting of all polynomial combinations of the features with degree less than or equal to the specified degree.
Incorrect! Try again.
13What is the main risk associated with using a high-degree polynomial in regression?
A.Underfitting
B.Overfitting
C.Convergence failure
D.High bias
Correct Answer: Overfitting
Explanation:
High-degree polynomials create highly complex models that can capture noise in the training data, leading to overfitting and poor generalization to new data.
Incorrect! Try again.
14Which of the following techniques helps reduce overfitting in regression models by adding a penalty term to the loss function?
A.Regularization
B.Augmentation
C.Standardization
D.Normalization
Correct Answer: Regularization
Explanation:
Regularization (like Ridge or Lasso) adds a penalty term based on the magnitude of the coefficients to the loss function to constrain the model complexity.
Incorrect! Try again.
15Ridge regression minimizes the sum of squared residuals plus a penalty term based on:
A.The number of non-zero coefficients.
B.The maximum coefficient value.
C.The sum of squared values of coefficients ( norm).
D.The sum of absolute values of coefficients ( norm).
Correct Answer: The sum of squared values of coefficients ( norm).
Explanation:
Ridge regression adds the penalty term (the norm) to the objective function.
Incorrect! Try again.
16Which property makes Lasso regression useful for feature selection?
A.It shrinks coefficients uniformly.
B.It works best when .
C.It increases the magnitude of coefficients.
D.It forces some coefficients to become exactly zero.
Correct Answer: It forces some coefficients to become exactly zero.
Explanation:
Due to the geometry of the penalty, Lasso regression tends to produce sparse solutions where irrelevant feature coefficients are driven exactly to zero.
Incorrect! Try again.
17In Scikit-Learn, which regression model combines both and regularization penalties?
A.Lasso
B.BayesianRidge
C.ElasticNet
D.Ridge
Correct Answer: ElasticNet
Explanation:
ElasticNet is a linear regression model that trains with both and priors as regularizers. It is useful when there are multiple features which are correlated.
Incorrect! Try again.
18In regularized regression, what is the role of the hyperparameter (or )?
A.It controls the learning rate.
B.It controls the strength of the regularization penalty.
C.It sets the intercept to zero.
D.It determines the degree of the polynomial.
Correct Answer: It controls the strength of the regularization penalty.
Explanation:
A higher increases the penalty, shrinking coefficients more (reducing variance but increasing bias). If , it becomes standard OLS.
Incorrect! Try again.
19Why is feature scaling (e.g., Standardization) important before applying Ridge or Lasso regression?
A.To convert categorical data to numeric.
B.To remove missing values.
C.Because the penalty term is sensitive to the scale of the coefficients.
D.To ensure the target variable is normally distributed.
Correct Answer: Because the penalty term is sensitive to the scale of the coefficients.
Explanation:
Regularization penalizes coefficient magnitude. If features are on different scales, the penalty will unevenly affect features with smaller ranges vs. larger ranges, leading to a biased model.
Incorrect! Try again.
20Support Vector Regression (SVR) tries to fit as many data points as possible within a margin of width:
A.
B.Zero
C. (epsilon)
D.
Correct Answer: (epsilon)
Explanation:
SVR uses an -insensitive tube. Errors within distance from the predicted line are ignored. The goal is to fit the tube around the data.
Incorrect! Try again.
21In Support Vector Regression, what is the role of the kernel function?
A.To calculate the error metric.
B.To map the input data into a higher-dimensional feature space to handle non-linearity.
C.To normalize the target variable.
D.To select the best features.
Correct Answer: To map the input data into a higher-dimensional feature space to handle non-linearity.
Explanation:
Kernels (like RBF or Polynomial) allow SVR to find linear relationships in high-dimensional spaces, which correspond to non-linear relationships in the original input space.
Incorrect! Try again.
22Which parameter in SVR controls the trade-off between the smoothness of the decision function and the tolerance for training errors?
A.Gamma
B.Kernel
C.C
D.Degree
Correct Answer: C
Explanation:
is the regularization parameter. A high attempts to classify all training examples correctly (low bias, high variance), while a low encourages a smoother decision surface.
Incorrect! Try again.
23What is the primary criterion used by Decision Tree Regressors to split a node?
A.Log-Loss
B.Gini Impurity
C.Information Gain
D.MSE (Variance reduction)
Correct Answer: MSE (Variance reduction)
Explanation:
For regression trees, splits are chosen to minimize the Mean Squared Error (MSE) or variance within the resulting child nodes.
Incorrect! Try again.
24One major advantage of Decision Tree Regression is:
C.It does not require feature scaling or normalization.
D.It always extrapolates well.
Correct Answer: It does not require feature scaling or normalization.
Explanation:
Decision trees split data based on thresholds of individual features, so the absolute scale or distribution of features does not affect the structure of the tree.
Incorrect! Try again.
25What is a characteristic behavior of a Decision Tree Regressor when predicting values outside the range of the training data?
A.It extrapolates linearly.
B.It returns a null value.
C.It automatically creates a polynomial fit.
D.It predicts the average of the closest training samples (constant prediction).
Correct Answer: It predicts the average of the closest training samples (constant prediction).
Explanation:
Decision trees are piecewise constant models. They cannot extrapolate trends; for inputs outside the training range, they predict the value associated with the nearest leaf node.
Incorrect! Try again.
26Random Forest Regression improves upon a single Decision Tree by utilizing which technique?
A.Gradient Boosting
B.Kernel trick
C.Pruning
D.Bagging (Bootstrap Aggregating)
Correct Answer: Bagging (Bootstrap Aggregating)
Explanation:
Random Forests build multiple trees on bootstrap samples of the data and average their predictions to reduce variance and overfitting.
Incorrect! Try again.
27In a Random Forest Regressor, how is the final prediction determined?
A.The prediction of the tree with the highest accuracy.
B.Majority vote of the trees.
C.Weighted sum of the features.
D.Average of the predictions of all individual trees.
Correct Answer: Average of the predictions of all individual trees.
Explanation:
For regression tasks, the Random Forest averages the continuous output values of all the trees in the ensemble.
Incorrect! Try again.
28Which parameter in RandomForestRegressor determines the number of trees in the forest?
A.min_samples_split
B.bootstrap
C.n_estimators
D.max_depth
Correct Answer: n_estimators
Explanation:
n_estimators specifies the number of decision trees to be generated in the forest.
Incorrect! Try again.
29Random Forests introduce randomness in two ways: bootstrap sampling and:
A.Selecting a random subset of features at each split.
B.Random initialization of weights.
C.Randomly shuffling the target labels.
D.Randomly pruning the trees.
Correct Answer: Selecting a random subset of features at each split.
Explanation:
At each node split, Random Forest only considers a random subset of features (controlled by max_features) to decorrelate the trees.
Incorrect! Try again.
30What is the 'Out-of-Bag' (OOB) score in Random Forests?
A.The training error of the full ensemble.
B.A validation score calculated using the samples not included in the bootstrap sample for each tree.
C.The accuracy on the test set.
D.The error rate of the worst tree.
Correct Answer: A validation score calculated using the samples not included in the bootstrap sample for each tree.
Explanation:
About 1/3 of the data is not used (out-of-bag) for training a specific tree. These samples can be used to estimate the generalization error without a separate validation set.
Incorrect! Try again.
31Which Scikit-Learn function splits a dataset into training and testing sets?
train_test_split is the standard utility to split arrays or matrices into random train and test subsets.
Incorrect! Try again.
32In the equation for ElasticNet: , what does (or l1_ratio in scikit-learn) control?
A.The tolerance for stopping criteria.
B.The degree of the polynomial.
C.The overall regularization strength.
D.The mix between Ridge and Lasso regularization.
Correct Answer: The mix between Ridge and Lasso regularization.
Explanation:
The l1_ratio () controls the balance. If , it is Lasso; if , it is Ridge; values in between mix both penalties.
Incorrect! Try again.
33A residual plot shows the residuals on the y-axis and the predicted values on the x-axis. What pattern indicates a good regression model?
A.A clear U-shape curve.
B.A linear trend.
C.A funnel shape (heteroscedasticity).
D.Points randomly scattered around the horizontal axis (zero).
Correct Answer: Points randomly scattered around the horizontal axis (zero).
Explanation:
If residuals are randomly scattered around zero with no discernable pattern, it indicates that the model has captured the underlying trend and the errors are random noise.
Incorrect! Try again.
34When using SGDRegressor from Scikit-Learn, which hyperparameter defines the update rule schedule (how the learning rate changes over time)?
A.learning_rate
B.loss
C.alpha
D.penalty
Correct Answer: learning_rate
Explanation:
The learning_rate parameter (options like 'constant', 'optimal', 'invscaling', 'adaptive') determines how the step size changes during training.
Incorrect! Try again.
35Which of the following is an intrinsic weakness of Linear Regression?
A.It is difficult to interpret.
B.It is computationally expensive.
C.It cannot model non-linear relationships without feature engineering.
D.It requires categorical features.
Correct Answer: It cannot model non-linear relationships without feature engineering.
Explanation:
Standard Linear Regression assumes a linear relationship. To model curves, one must manually transform features (e.g., polynomial features) or use a different model.
Incorrect! Try again.
36In the context of regression metrics, what does Median Absolute Error provide that Mean Absolute Error does not?
A.Robustness to outliers.
B.Percentage error calculation.
C.Squared penalization.
D.Differentiability.
Correct Answer: Robustness to outliers.
Explanation:
By taking the median of the absolute errors, this metric ignores the influence of extreme outliers, whereas the Mean is pulled towards outliers.
Incorrect! Try again.
37What is Multicollinearity?
A.When the model has too many polynomial features.
B.When the training data is too small.
C.When independent features are highly correlated with each other.
D.When the target variable is categorical.
Correct Answer: When independent features are highly correlated with each other.
Explanation:
Multicollinearity occurs when features are linearly dependent. This can make coefficient estimates unstable and difficult to interpret in linear models.
Incorrect! Try again.
38How does DecisionTreeRegressor handle missing values in Scikit-Learn (standard implementation)?
A.It handles them natively.
B.It ignores the rows with missing values.
C.It treats them as a separate category.
D.It requires imputation (filling missing values) before training.
Correct Answer: It requires imputation (filling missing values) before training.
Explanation:
Scikit-Learn's CART implementation currently does not support missing values natively; an imputer (e.g., SimpleImputer) is required.
Incorrect! Try again.
39Which plot is typically used to inspect if the residuals follow a normal distribution?
A.Box plot
B.Bar chart
C.Scatter plot
D.Q-Q (Quantile-Quantile) plot
Correct Answer: Q-Q (Quantile-Quantile) plot
Explanation:
A Q-Q plot compares the quantiles of the residuals against the quantiles of a theoretical normal distribution. A straight line indicates normality.
Incorrect! Try again.
40In Polynomial Regression, if you increase the degree of the polynomial significantly, the model becomes:
A.More biased.
B.Linear.
C.More complex with higher variance.
D.Less flexible.
Correct Answer: More complex with higher variance.
Explanation:
Higher degrees allow the model to wiggle and fit training points precisely, increasing complexity and variance (risk of overfitting).
Incorrect! Try again.
41What is the result of applying fit_transform on the training data and then transform on the test data during scaling?
A.Correct application of preprocessing parameters learnt from training to test data.
B.Data leakage.
C.Incorrect scaling.
D.Overfitting.
Correct Answer: Correct application of preprocessing parameters learnt from training to test data.
Explanation:
You learn the parameters (mean, std) from the training set (fit) and apply them to both (transform) to ensure the test set represents unseen data scaled to the same reference.
Incorrect! Try again.
42Which Scikit-Learn attribute holds the estimated coefficients for a Linear Regression model after fitting?
A.model.params_
B.model.coef_
C.model.intercept_
D.model.weights_
Correct Answer: model.coef_
Explanation:
coef_ is the attribute containing the weights (coefficients) for the features. intercept_ holds the bias term.
Incorrect! Try again.
43What is the analytical solution to find the optimal weights for Linear Regression called?
A.Coordinate Descent
B.Gradient Descent
C.Backpropagation
D.The Normal Equation
Correct Answer: The Normal Equation
Explanation:
The Normal Equation is a closed-form solution: .
Incorrect! Try again.
44When using Support Vector Regression with an RBF kernel, what happens if the parameter (gamma) is very large?
A.The model behaves like a linear regression.
B.The influence of each training example is limited to a close radius, leading to overfitting.
C.The model becomes a flat line.
D.The influence of each training example reaches very far.
Correct Answer: The influence of each training example is limited to a close radius, leading to overfitting.
Explanation:
High gamma means the Gaussian curve is narrow; the model captures complex details around individual points, often causing overfitting.
Incorrect! Try again.
45Why might one use Adjusted instead of standard ?
A.To ensure the score is always positive.
B.To handle categorical variables.
C.To account for the number of predictors, penalizing the addition of useless features.
D.To calculate error in absolute terms.
Correct Answer: To account for the number of predictors, penalizing the addition of useless features.
Explanation:
Standard never decreases when features are added. Adjusted decreases if the new feature doesn't improve the model more than chance would expect.
Incorrect! Try again.
46In the context of Bias-Variance tradeoff, a simple linear model with few features typically has:
A.Low Bias and High Variance
B.High Bias and High Variance
C.Low Bias and Low Variance
D.High Bias and Low Variance
Correct Answer: High Bias and Low Variance
Explanation:
Simple models may fail to capture complex patterns (High Bias/Underfitting) but are stable and don't change much with different training sets (Low Variance).
Incorrect! Try again.
47Which of the following creates a pipeline in Scikit-Learn that scales data then fits a regressor?
make_pipeline constructs a pipeline that sequentially applies a list of transforms (Scaler) and a final estimator (Regressor).
Incorrect! Try again.
48What is the interpretation of the slope coefficient in the model ?
A.The value of when .
B.The correlation between and .
C.The percentage change in .
D.The change in for a one-unit increase in .
Correct Answer: The change in for a one-unit increase in .
Explanation:
In a linear equation, the slope represents the rate of change of the dependent variable per unit change in the independent variable.
Incorrect! Try again.
49Which regression algorithm constructs a model based on the principle of 'recursive binary splitting'?
A.Decision Tree Regression
B.Linear Regression
C.Support Vector Regression
D.Ridge Regression
Correct Answer: Decision Tree Regression
Explanation:
Decision trees are built by recursively splitting the data into two subsets based on feature thresholds.
Incorrect! Try again.
50When interpreting a heatmap of a correlation matrix, a value of -0.9 between two features indicates:
A.A strong negative linear relationship.
B.A strong positive linear relationship.
C.A weak negative linear relationship.
D.No linear relationship.
Correct Answer: A strong negative linear relationship.
Explanation:
Correlation coefficients range from -1 to 1. Values close to -1 indicate a strong inverse (negative) linear relationship.
Incorrect! Try again.
Did this save you a night before the exam?
LPU Notes is free, and it stays free. Ads cover part of the server bill.
The rest comes out of a student's own pocket: the domain, the storage,
and keeping the site up through the weeks everyone needs it at once.
The payment button didn't load. An ad blocker or a filtered network is the usual reason.
to try again.
Nothing here is ever locked, and nothing unlocks. Chip in only if it was worth it.
What it pays for →