Quiz Space

Machine Learning Practice · End Term · 3 Sept 2023 · May 2023 term · Set QPD1-S1

Question 4: Consider the following Python code snippet that demonstra…

Question 4

+2 marksOne correct option

Consider the following Python code snippet that demonstrates the use of GaussianNB from scikit-learn:

python
from sklearn.naive_bayes import GaussianNB
import numpy as np
X = np.array([[1.0, 2.0],
[2.5, 3.5],
[3.0, 5.0]])
y = np.array([0, 1, 0])
classifier = GaussianNB()
classifier.fit(X, y)
new_data = np.array([[2.0, 3.0]])
predicted_proba = classifier.predict_proba(new_data)

In the context of the code above, what information does the array predicted_proba contain?

  1. A

    The predicted classes for the new data points.

  2. B

    The decision boundary values for the classes.

  3. C

    The posterior probabilities of the classes for the new data points.

  4. D

    The likelihood estimates for the new data points.

Show answer

Correct answer

  • C

    The posterior probabilities of the classes for the new data points.

Video solution

The video solution to this question is being recorded and will play here. Until then, the answer key is above.

Question 4 of 34 in the IIT Madras BS Machine Learning Practice (MLP) End Term paper sat on 3 Sept 2023, in the May 2023 term (IIT M DIPLOMA ET1 EXAM QPD1 S2 03 Sep). It carries 2 marks.

This question was also asked in

More questions from this paper

  1. Q1What will be the output of the following code:
  2. Q2What will be the numerical value in the output array of the following code:
  3. Q3Given below a y_train list which consists of coffee order’s preference by the customers in a cafe. MultiLabelBinarizer …
  4. Q5Figure question
  5. Q6You’re working on a dataset containing customer purchase data, and you want to segment the customers into distinct grou…
  6. Q7You’re working with a dataset of geographical locations and want to group similar locations together based on their dis…
  7. Q8You’re analyzing a dataset of customer transaction histories. Each transaction includes the purchase amount and timesta…
  8. Q9Given the following code snippet, which statement is true regarding the use of LabelEncoder?
  9. Q10Figure question
  10. Q11Which of the following option(s) are correct regarding regularization?
  11. Q12Given the following code snippet that preprocesses a dataset with both continuous and categorical features using sklear…
  12. Q13Consider the following code snippet: If the shape of X is (20640, 8), what will be the shape of X_transformed?
  13. Q14What is the main principle behind a dummy regressor’s prediction strategy?
  14. Q15Consider the following Python code snippet that demonstrates the use of StandardScaler from scikit-learn: What does the…
  15. Q16Figure question
  16. Q17Figure question
  17. Q18Figure question
  18. Q19You’re working on a binary classification problem where the dataset is relatively small, and you suspect that a linear …
  19. Q20Figure question
  20. Q21You’re designing an ‘MLPClassifier’ for an image recognition task. The dataset consists of grayscale images of animals.…
  21. Q22You’re working on a binary classification task using the ‘MLPClassifier’ to predict whether a customer will make a purc…
  22. Q23For LinearRegression with equation Y = W_0X_0 + W_1X_1 + W_2X_2 + \epsilon and given that W_2 = \frac{5}{7} W_1 and \ep…
  23. Q24Using the confusion matrix given below. What is the precision score for the label (class) 1 ?
  24. Q25What will be the output of the following code snippet?
  25. Q26What is the output of the following code?
  26. Q27Which of the following statements are true?
  27. Q28Fill in the missing parameter value in the following estimator that can be used to classify the data
  28. Q29Consider the following code snippet where two decision trees are trained on the same dataset: Given the configurations …
  29. Q30Given the following code using BaggingClassifier with KNeighborsClassifier as the base estimator: Which of the followin…
  30. Q31Figure question
  31. Q32Figure question
  32. Q33Figure question
  33. Q34You’re working with a dataset of customer purchase behavior, including attributes “Total Amount Spent” and “Number of I…