NPTEL Data Science for Engineers Week 7 Assignment Answers 2025
1. Which among the following is not a type of cross-validation technique?
- a. LOOCV
- b. k-fold cross validation
- c. Validation set approach
- d. Bias variance trade off
✅ Answer :- d
✏️ Explanation: Bias-variance trade-off is a concept, not a validation technique. The other three are standard cross-validation methods.
2. Which among the following is a classification problem?
- a. Predicting the average rainfall in a given month.
- b. Predicting whether a patient is diagnosed with a disease or not.
- c. Predicting the price of a house.
- d. Predicting whether it will rain or not tomorrow.
Consider the following confusion matrix for the classication of Hatchback and SUV:
✅ Answer :- b, d
✏️ Explanation: Classification problems involve predicting discrete outcomes (like Yes/No, 0/1). Options b and d are binary classifications.
3. Find the accuracy of the model.
- a. 0.95
- b. 0.55
- c. 0.45
- d. 0.88
✅ Answer :- a
✏️ Explanation: Accuracy = (TP + TN) / Total samples. Based on the assumed values, the model achieves 95% accuracy.
4. Find the sensitivity of the model.
- a. 0.95
- b. 0.55
- c. 1
- d. 0.88
✅ Answer :- c
✏️ Explanation: Sensitivity = TP / (TP + FN). If there are no false negatives, sensitivity is 1, meaning the model identifies all positive cases.
5. Under the ‘family’ parameter of glm() function, which one of the following distributions correspond to logistic regression for a variable with binary output?
- a. Binomial
- b. Gaussian
- c. Gamma
- d. Poisson
✅ Answer :- a
✏️ Explanation: Logistic regression in R uses family = binomial
for binary classification.
6. What is the dimension of the dataframe?
- a. (150, 5)
- b. (150, 4)
- c. (50, 5)
- d. None of the above
✅ Answer :- a
✏️ Explanation: The classic Iris dataset has 150 rows (flowers) and 5 columns (4 features + 1 label).
7. What can you comment on the distribution of the independent variables in the dataframe?
- a. The variables Sepal Length and Sepal Width are not normally distributed
- b. All the variables are normally distributed
- c. The variable Petal Length alone is normally distributed
- d. None of the above
✅ Answer :- b
✏️ Explanation: The Iris dataset features are often treated as normally distributed for statistical modeling.
8. How many rows in the dataset contain missing values?
- a. 10
- b. 5
- c. 25
- d. 0
✅ Answer :- d
✏️ Explanation: The Iris dataset is clean and contains no missing values.
9. Which of the following code blocks can be used to summarize the data (finding the mean of the columns PetalLength and PetalWidth), similar to the one given below?
- a.
lapply(irisdata[, 3:4], mean)
- b.
sapply(irisdata[, 3:4], 2, mean)
- c.
apply(irisdata[, 3:4], 2, mean)
- d.
apply(irisdata[, 3:4], 1, mean)
✅ Answer :- a, c
✏️ Explanation:
lapply()
andapply(..., 2, ...)
apply functions column-wise.- Option b has incorrect syntax.
- Option d calculates row-wise mean, not required here.
10. What can be interpreted from the plot shown below?
- a. Sepal widths of Versicolor flowers are lesser than 3 cm.
- b. Sepal lengths of Setosa flowers are lesser than 6 cm.
- c. Sepal lengths of Virginica flowers are greater than 6 cm.
- d. Sepals of Setosa flowers are relatively more wider than Versicolor flowers.
✅ Answer :- b, d
✏️ Explanation:
- Setosa has shorter sepals.
- Setosa sepals are generally wider than Versicolor, which is visible in boxplots or violin plots.