0% found this document useful (0 votes)
12 views3 pages

Machine Learning Assignment-6.Sol

The document is an assignment on machine learning consisting of multiple-choice questions (Q1-Q9) and subjective questions (Q10-Q15). It covers topics such as overfitting, decision trees, ensemble techniques, regularization, and model evaluation metrics. The subjective questions require explanations on adjusted R-squared, differences between Ridge and Lasso regression, the importance of data scaling, and various metrics for assessing the goodness of fit in linear regression.

Uploaded by

faltukaamdone
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views3 pages

Machine Learning Assignment-6.Sol

The document is an assignment on machine learning consisting of multiple-choice questions (Q1-Q9) and subjective questions (Q10-Q15). It covers topics such as overfitting, decision trees, ensemble techniques, regularization, and model evaluation metrics. The subjective questions require explanations on adjusted R-squared, differences between Ridge and Lasso regression, the importance of data scaling, and various metrics for assessing the goodness of fit in linear regression.

Uploaded by

faltukaamdone
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

ASSIGNMENT - 6

MACHINE LEARNING

In Q1 to Q5, only one option is correct, Choose the correct option:


1. In which of the following you can say that the model is overfitting?
A) High R-squared value for train-set and High R-squared value for test-set.
B) Low R-squared value for train-set and High R-squared value for test-set.
C) High R-squared value for train-set and Low R-squared value for test-set.
D) None of the above
Answer: (C)High R-squared value for train-set and Low R-squared value for test-set.

2. Which among the following is a disadvantage of decision trees?


A) Decision trees are prone to outliers.
B) Decision trees are highly prone to overfitting.
C) Decision trees are not easy to interpret
D) None of the above.
Answer:B) Decision trees are highly prone to over ng

3. Which of the following is an ensemble technique?


A) SVM B) Logistic Regression
C) Random Forest D) Decision tree
Answer: C) Random Forest
4. Suppose you are building a classification model for detection of a fatal disease where detection of
the disease is most important. In this case which of the following metrics you would focus on?
A) Accuracy B) Sensitivity
C) Precision D) None of the above.
Answer: C) Sensi vity

5. The value of AUC (Area under Curve) value for ROC curve of model A is 0.70 and of model B is
0.85. Which of these two models is doing better job in classification?
A) Model A B) Model B
C) both are performing equal D) Data Insufficient
Answer: b) Model B

In Q6 to Q9, more than one options are correct, Choose all the correct options:
6. Which of the following are the regularization technique in Linear Regression??
A) Ridge B) R-squared
C) MSE D) Lasso
Answer: a. Ridge and d. Lasso

7. Which of the following is not an example of boosting technique?


A) Adaboost B) Decision Tree
C) Random Forest D) Xgboost.
Answer: b. Decision Tree and c. Random Forest
8. Which of the techniques are used for regularization of Decision Trees?
A) Pruning B) L2 regularization
C) Restricting the max depth of the tree D) All of the above
ti
fi
tti
Answer: a. Pruning and c. Restric ng the max depth of the tree

9. Which of the following statements is true regarding the Adaboost technique?


A) We initialize the probabilities of the distribution as 1/n, where n is the number of data-points
B) A tree in the ensemble focuses more on the data points on which the previous tree was not
performing well
C) It is example of bagging technique
D) None of the above
Answer: A ) We initialize the probabilities of the distribution as 1/n, where n is the number of data-points
B) A tree in the ensemble focuses more on the data points on which the previous tree was not
performing well.

Q10 to Q15 are subjective answer type questions, Answer them briefly.
10. Explain how does the adjusted R-squared penalize the presence of unnecessary predictors in the
model?
Answer: The adjusted R-squared is a modi ed version of the R- squared that penalizes
the addi on of unnecessary predictors to the model. As more predictors are added to the model,
the R- squared value will typically increase, even if the predictors are not useful. The adjusted R-
squared accounts for this by adjus ng the R- squared value based on the number of predictors in
the model. It is a more reliable indicator of the goodness of t of a model and is useful in
comparing models with di erent numbers of predictors.

11. Differentiate between Ridge and Lasso Regression.


Answer: Ridge and Lasso regression are both regulariza on techniques used to prevent
over ng in linear regression. Ridge regression adds a penalty term to the cost func on that is
propor onal to the square of the magnitude of the coe cients. This helps to shrink the
coe cients of less important predictors towards zero, but does not set any coe cients exactly to
zero. Lasso regression, on the other hand, adds a penalty term to the cost func on that is
propor onal to the absolute value of the coe cients. This can result in some coe cients being
set exactly to zero, e ec vely performing feature selec on.

12. What is VIF? What is the suitable value of a VIF for a feature to be included in a regression
modelling?
Answer: VIF stands for Variance In a on Factor, it is a measure of how much the variance of
the es mated regression coe cients are increased because of collinearity. A high VIF indicates
that the corresponding predictor is highly correlated with one or more of the other predictors. A
VIF value of 1 indicates that there is no correla on between this predictor and any other
predictors, while a value greater than 1 indicates that there is correla on. A suitable value of VIF
for a feature to be included in a regression modeling is typically less than 5 or 10.

13. Why do we need to scale the data before feeding it to the train the model?
Answer: Scaling the data is important before training a model because many machine learning algorithms use
distance based calcula ons. So if the data is not scaled, then the algorithm will be sensi ve to the scale of the
data. For example, if one feature is measured in kilometers and another feature is measured in meters, then the
algorithm will be biased towards the feature measured in kilometers. Scaling the data ensures that all the features
are on the same scale, which leads to a fair comparison of the importance of each feature.
ffi
fi
tti
ti
ti
ti
ti
ti
ff
ti
ff
ffi
ti
ti
fl
ti
ffi
ti
fi
ti
ffi
ti
fi
ti
ti
ti
ffi
ffi
ti
ASSIGNMENT - 6

MACHINE LEARNING

14. What are the different metrics which are used to check the goodness of fit in linear regression?
Answer: There are several metrics used to check the goodness of fit in linear regression,
some examples are:
R-squared: R-squared measures the propor on of varia on in the dependent variable that is
explained by the independent variables. It ranges from 0 to 1, where 1 indicates a perfect t.
Mean Squared Error (MSE): MSE is the average of the square of the residuals, it measures the
average di erence between the predicted values and the true values.
Root Mean Squared Error (RMSE): it is the square root of MSE and it gives the error in the same
unit as the response variable.
Mean Absolute Error (MAE): it is the mean of the absolute values of the residuals.
Adjusted R-squared: It is a modi ed version of the R-squared that penalizes the addi on of
unnecessary predictors to the model.
15. From the following confusion matrix calculate sensitivity, specificity, precision, recall and accuracy.

Actual/Predicted True False


True 1000 50
False 250 1200

Answer: Sensi vity (also known as recall) = True Posi ves / (True Posi ves + False Nega ves) =
1000 / (1000 + 250) = 0.8 Speci city = True nega ves / (True nega ves + False posi ves) =
1200 / (1200 + 50) = 0.96
Precision = True Posi ves / (True Posi ves + False Posi ves) = 1000 / (1000 + 50) = 0.95 Recall
= True Posi ves / (True Posi ves + False Nega ves) = 1000 / (1000 + 250) = 0.8
Accuracy = (True Posi ves + True nega ves) / (Total) = (1000 + 1200) / (1000+50+250+1200) =
0.89
Note: sensi vity and recall are the same.
ti
ff
ti
ti
ti
ti
ti
fi
ti
ti
fi
ti
ti
ti
ti
ti
ti
ti
ti
ti
ti
fi
ti

You might also like