Quiz Space

Machine Learning Practice · Quiz 1 · 29 Oct 2023 · September 2023 term

Question 8: Consider the following code: Which of the following may b…

Question 8

+2 marksOne correct option

Consider the following code:

python
import numpy as np
from sklearn.model_selection import ShuffleSplit
X = np.array([[24, 13],[19, 18],
[25, 18],[27, 23],
[11, 25],[22, 12],
[27, 16],[17, 25]])
y = np.array([-1, 1, -1, 1, 1, -1, 1, -1])
ss = ShuffleSplit(n_splits=3, test_size=.25, random_state= 42)
for train_index, test_index in ss.split(X):
print(train_index,test_index)

Which of the following may be the correct output of the above code?:

  1. A
  2. B
  3. C
  4. D
Show answer

Correct answer

  • B

Question 8 of 23 in the IIT Madras BS Machine Learning Practice (MLP) Quiz 1 paper sat on 29 Oct 2023, in the September 2023 term (IIT M DIPLOMA AN2 EXAM QPD2 29 Oct 2023). It carries 2 marks.

More questions from this paper

  1. Q1Figure question
  2. Q2You are working on a machine learning project and have received a dataset containing numeric and categorical features. …
  3. Q3You’re working with a dataset that consists of training data (‘train_data’) and test data (‘test_data’). The dataset co…
  4. Q4You are working on a machine learning project that aims to predict housing prices based on various features of the hous…
  5. Q5Figure question
  6. Q6Imagine you’ve loaded a dataset with 1000 samples into a Pandas DataFrame, and each sample has 30 features. Unfortunate…
  7. Q7Choose the options with respect to the given statements:\ Statement1 : To apply various sklearn methods from in series …
  8. Q9Which of the following is likely to be the correct output of the code given below?
  9. Q10You are working on optimizing a machine learning model for predicting the energy efficiency of buildings. To capture po…
  10. Q11You’re developing a regression model for predicting house prices based on various attributes of a house. Given that som…
  11. Q12You are working on a regression problem and decide to use the SGDRegressor from scikit-learn. You set up two different …
  12. Q13Which columns <u>may not</u> be included in the selected data within the code below?
  13. Q14Which of the following code blocks will correctly take the learning rate as ‘optimal’ ?
  14. Q15While performing exploratory data analysis (EDA) on a dataset, you come across some columns with a high percentage of m…
  15. Q16Given the following code snippet involving GridSearchCV for hyperparameter tuning of a LinearRegression model: Select a…
  16. Q17Given the following code snippet, how many unique values will be present in the column Z of the resulting DataFrame df?
  17. Q18What will be the output of the following code ?
  18. Q19What will be the output of the following code ?
  19. Q20You’re using GridSearchCV to optimize a Ridge regression model from scikit-learn. Consider the following hyperparameter…
  20. Q21For LinearRegression with equation Y = W_0X_0+W_1X_1+W_2X2+\epsilon and given that W_2 = \frac{5}{7} W_1 and \epsilon =…
  21. Q22Which of the following options will be the output of the given code?
  22. Q23Which of the following could be the possible output of print(reg.score())?