Question 1 | MCQ
THIS IS QUESTION PAPER FOR THE SUBJECT"DIPLOMA LEVEL : MACHINE LEARNING PRACTICE (COMPUTER BASED EXAM)"
ARE YOU SURE YOU HAVE TO WRITE EXAM FOR THIS SUBJECT?
CROSS CHECK YOUR HALL TICKET TO CONFIRM THE SUBJECTS TO BE WRITTEN.
(IF IT IS NOT THE CORRECT SUBJECT, PLS CHECK THE SECTION AT THE TOP FOR THE SUBJECTS REGISTERED BY YOU)
ARE YOU SURE YOU HAVE TO WRITE EXAM FOR THIS SUBJECT?
CROSS CHECK YOUR HALL TICKET TO CONFIRM THE SUBJECTS TO BE WRITTEN.
(IF IT IS NOT THE CORRECT SUBJECT, PLS CHECK THE SECTION AT THE TOP FOR THE SUBJECTS REGISTERED BY YOU)
Solution
______________ generates a bunch of normally-distributed clusters of points with specific mean and standard deviations for each cluster.
Solution
Why is data preprocessing necessary?
Solution
Which of the following is correct with respect to R2-score?
Solution
Which options represent the output of the following code block?

Solution
Consider the following code block:

What will be the value of the ‘count’?
What will be the value of the ‘count’?
Solution
Consider the following code block:

Solution
Which of the following is a hyperparameter?
Solution
Solution
Consider the following code

Solution
Consider the following code:

Solution
Which of the following are correct about sklearn.svm.SVC:

Solution
Solution
Which of the following APIs only supports conjoining transformers and estimators in series (i.e. one after another)?
Solution
Consider the following ML task/steps for a regression dataset:
1. Read the data from a file (named ‘dataset.csv’). It has 7 columns. The last column is the target variable, all 6 features numerical.
2. Remove rows which have target values missing.
3. Fill the missing values in the features by KNN using 3 nearest neighbours.
4. Split the data into training and test sets. Take randomly the 70% of rows in the training set and
the rest of them into the test set.
5. Train a simple linear regression model, with intercept, on the training set.
6. Report R2 score on the test set.
Which of the following code snippets correctly accomplishes the above task? Assume necessary imports.
1. Read the data from a file (named ‘dataset.csv’). It has 7 columns. The last column is the target variable, all 6 features numerical.
2. Remove rows which have target values missing.
3. Fill the missing values in the features by KNN using 3 nearest neighbours.
4. Split the data into training and test sets. Take randomly the 70% of rows in the training set and
the rest of them into the test set.
5. Train a simple linear regression model, with intercept, on the training set.
6. Report R2 score on the test set.
Which of the following code snippets correctly accomplishes the above task? Assume necessary imports.
Solution
Solution
Consider the following statements about SGDClassifier:
1. It can be used to train a model on large dataset that doesn’t fit in main memory
2. It can emulate a KNN model
3. It can emulate a decision tree model
4. It can emulate a perceptron
Choose the correction option(s)
1. It can be used to train a model on large dataset that doesn’t fit in main memory
2. It can emulate a KNN model
3. It can emulate a decision tree model
4. It can emulate a perceptron
Choose the correction option(s)
Solution
Consider an image classification task: an image can have dogs, birds and trees. An image can have any combination of these three. The classifier is expected to report all these three for every sample. What kind of classification problem is this?
Solution
Consider following code snippets, assuming necessary imports.

Solution
Which of the following options is true for the gamma parameter in a non-linear soft margin SVM?
Solution
Consider the following code:

Solution
Following is the code to tune the n_estimators parameter of a Bagging Classifier model.

Solution
Consider the following code. How many DecisionTreeClassifier models will be trained internally?

Solution
Consider two classifiers as shown in the following block of code:

Solution
Consider the following code:

Solution
Suppose that we have 10000 samples in a dataset. Suppose further we use theK− means algorithm to find clusters in the dataset. Then, the statement that K-Means algorithm always converges with zero inertia (or zero Sums Square Error) for some value ofKis
Solution
Suppose that we use k-means clustering for a dataset having 100 samples. The initial centroids for kclusters can be initialized in multiple ways. One such as way is shown below

Solution
We wish to load the wine dataset from sklearn. Which of the following will throw an error?
Solution
Which of the following is correct?
Solution
Which of the following algorithms may get impacted by feature scaling?
Solution
Which of the following class(es) is (are) used to instantiate a neural network in Sklearn.
Solution
Solution
Which of the following ways can help in feature selection?
Solution
Consider the following block of code:

Solution
The code given below attempts to find the clusters in the dataset,Xusing the K-means algorithm.

Solution
The following line of code creates a neural network (assume necessary imports)

Select the correct statements from the following list of statements
Select the correct statements from the following list of statements
Solution
Consider the following code block:

Solution
Shape
Thickness [ / ]
3
All colors