Question 1 | MCQ
THIS IS QUESTION PAPER FOR THE SUBJECT "DIPLOMA LEVEL : MACHINE LEARNING PRACTICE"
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
[String Matching] Enter the sequence of steps to be followed, in general, in end to end machine learning project. Enter the answer as a 6-character string. For example, entering the answer as (without quotes) ‘BADCFE’ implies that the first step is B, followed by the second step A and so on. A. Select suitable model
B. Train the model
C. Pre-process the data
D. Collect data
E. Fine tune model
F. Present your solution
B. Train the model
C. Pre-process the data
D. Collect data
E. Fine tune model
F. Present your solution
Solution
Which of the following APIs can be used to construct an ML pipeline for data preprocessing and modeling?
Solution
Consider following data:

Which one of the following APIs can be used to extract features from the above data?
Which one of the following APIs can be used to extract features from the above data?
Solution
Consider following data:

Solution
Suppose that we load a data set that contains 1000 samples in a Pandas Dataframe. Each sample has 30 features. However, a few samples in the data set miss the values for all features. Therefore, those samples need to be dropped. Choose the method that removes such samples from the dataset?
Solution
The statement that each feature in the input data set has a (physical) meaning associated with it is
Solution
A company collects 40000 samples (examples) to build a Machine Learning model for an application. They decide to use 30% of the total samples for testing (to be stored in the variable trainset) and the rest 70% for training (to be stored in the variable trainset). They also want to sample the same set of samples across multiple runs. Which of the following line (statement) achieves this task? Assume that all samples are stored in the variable data.
Solution
Which of the following utilities of sklearn.datasets helps us to get the realworld data from the internet?
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, the rest of them are numerical features.
2. Drop rows with missing values.
3. After removing samples with missing values split the data into training and test sets. Take about the first 80% of rows in the training set and the rest of them into the test set.
4. Train a simple linear regression model, with intercept, on the training set.
5. 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, the rest of them are numerical features.
2. Drop rows with missing values.
3. After removing samples with missing values split the data into training and test sets. Take about the first 80% of rows in the training set and the rest of them into the test set.
4. Train a simple linear regression model, with intercept, on the training set.
5. Report R2 score on the test set.
Which of the following code snippets correctly accomplishes the above task? Assume necessary imports.
Solution
Consider the following code where X_train, y_train is the training data. X_test, y_test is the test data.

Which evaluation metric will be contained in the ‘score’?
Which evaluation metric will be contained in the ‘score’?
Solution
How to make SGDRegressor stop after 1000 epochs?
Solution
Suppose we want to transform features in a dataset using polynomial transformation. The sklearn API provides the functionality in which of the following modules?
Solution
Consider following dataset:

Which one of the following code snippets will correctly preprocess above data? Assume necessary imports. The data is stored in a dataframe named X.
Which one of the following code snippets will correctly preprocess above data? Assume necessary imports. The data is stored in a dataframe named X.
Solution
For a dataset with 1000 data points and 100 features, the following code will generate how many models during execution?
Note: X is the feature matrix and y is the target vector.

Note: X is the feature matrix and y is the target vector.
Solution
Consider the following cross-validation strategy:

Assume we apply this strategy to some data set. Which of the following options is/are correct?
Assume we apply this strategy to some data set. Which of the following options is/are correct?
Solution
Which of the following code is correct if we want the mean absolute error to be minimized during the computation of cross_val_score?
Solution
We know that applying polynomial transformation to the samples is often helpful. Assume we imported all the required modules.

Solution
A team has built a dataset for a regression problem. It contains 1000 samples. Each sample x is of size 2. All the features are binary, that is, xi ∈ {0, 1}. The team decided to use polynomial feature transformation of degree 2 as follows,

Solution
Consider a regression problem with L2 regularization. Suppose we instantiate the model as shown below,

What is the range of ‘alpha’?
What is the range of ‘alpha’?
Solution
(Multiple Select) Consider a data set shown below. The data set was loaded using Pandas and stored in the variable ‘data’ as a data frame.

Suppose that we want to get the value of ‘chlorides‘ of the third sample (2nd by index). Which of the following lines of code does this?
Suppose that we want to get the value of ‘chlorides‘ of the third sample (2nd by index). Which of the following lines of code does this?
Solution
(MSQ) Suppose that we plot the histogram of numerical features in a data set. This reveals which of the following information?
Solution
Why is data preprocessing necessary?
Solution
[MSQ] Which of the following will produce constantly reducing learning rates?
Solution
Shape
Thickness [ / ]
3
All colors