Quiz Space

Machine Learning Practice · End Term · 13 Apr 2025 · January 2025 term · Set QDD1

Question 8: Given the following information, what will be the output …

Question 8

+2 marksOne correct option

Given the following information, what will be the output of the code snippet?

  • continuous: yy is an array-like of floats that are not all integers, and is 1D or a column vector.
  • continuous-multioutput: yy is a 2D array of floats that are not all integers, and both dimensions are of size >1> 1.
  • binary: yy contains ≤2\leq 2 discrete values and is 1D or a column vector.
  • multiclass: yy contains more than two discrete values, is not a sequence of sequences, and is 1D or a column vector.
  • multiclass-multioutput: yy is a 2D array that contains more than two discrete values, is not a sequence of sequences, and both dimensions are of size >1> 1.
  • multilabel-indicator: yy is a label indicator matrix, an array of two dimensions with at least two columns, and at most 2 unique values.
  • unknown: yy is array-like but none of the above, such as a 3D array, sequence of sequences, or an array of non-sequence objects.
python
from sklearn.utils.multiclass import type_of_target
import numpy as np
print(type_of_target(['a', 'b', 'a']))
print(type_of_target(np.array([['horror','fantasy'],
['adventure','fantasy'],
['adventure','fantasy']])))
print(type_of_target(np.array([[2.0, 3.0], [3.0, 2.0]])))
print(type_of_target(np.array([[0, 1], [1, 1]])))
  1. A
  2. B
  3. C
  4. D
Show answer

Correct answer

  • C

Question 8 of 30 in the IIT Madras BS Machine Learning Practice (MLP) End Term paper sat on 13 Apr 2025, in the January 2025 term (IIT M DIPLOMA AN EXAM QDD3 13 Apr 2025). It carries 2 marks.

More questions from this paper

  1. Q1Given the following code snippet that preprocesses a dataset with both continuous and categorical features using sklear…
  2. Q2What will be the output of the following code?
  3. Q3Imagine you are using a Dummy Regressor with strategy=median. Given the following dataset: | S.No | X_1 | X_2 | X_3 | Y…
  4. Q4You want to implement an SGDRegressor using scikit-learn with the following specifications: Maximum iterations: 1000 Ea…
  5. Q5What is the primary computational bottleneck of the KNeighborsClassifier?
  6. Q6Figure question
  7. Q7The following code attempts to implement polynomial regression (degree 4) on the California housing dataset. Please sel…
  8. Q9Figure question
  9. Q10What will be the output of the following code snippet?
  10. Q11The following code snippet shows the use of two models built on the data X and label y: For the given data, which of th…
  11. Q12Figure question
  12. Q13Figure question
  13. Q14Figure question
  14. Q15Consider the following Python code snippet and the given dataset that has been stored in the data variable that demonst…
  15. Q16Figure question
  16. Q17Figure question
  17. Q18Which of the following techniques can be used for hyperparameter tuning in Ridge Regression? Select all correct options.
  18. Q19Figure question
  19. Q20In top-down (divisive) hierarchical clustering, clusters are recursively split until each data point is its own cluster…
  20. Q21You are training a Multi-Layer Perceptron (MLP) using Scikit-Learn's MLPClassifier for a binary classification task. Ho…
  21. Q22Which of the following statements are true with regard to logistic regression?
  22. Q23Consider the following code snippet: If the shape of X is (150, 4), what will be the number of features in X_transforme…
  23. Q24Use the confusion matrix given below. What is the recall score for the label (class) 1 ?
  24. Q25Based on the above data, answer the given subquestions.
  25. Q26Based on the above data, answer the given subquestions.
  26. Q27What is the output of the following code snippet: Enter -1, if you think the above statement will generate an error.
  27. Q28Consider following common data: Consider the above classification report on a model where y_test contains the original …
  28. Q29Consider following common data: Consider the above classification report on a model where y_test contains the original …
  29. Q30Consider following common data: Consider the above classification report on a model where y_test contains the original …