Font size
WorksheetsMLSC
Total questions: 120
Worksheet time: 1hrs 4mins
How many types of Machine Learning Techniques?
3
5
7
9
Machine Learning is a field of AI consisting of learning algorithms that_________
At executing some task
Over time with experience
Improve their performance
All of the above
In the image below, which would be the best value for k assuming that the algorithm you are using is k-Nearest Neighbor.?
3
10
50
What is a Naïve Bayes Classifier Theorem Equation?
P(A∣B)=P(B)P(B∣A)P(A)
P(B∣B)=P(B)P(B∣A)P(A)
P(B∣B)=P(A)P(B∣A)P(A)
P(A∣B)=P(A)P(A∣B)P(B)
Which of the following will be true about k in K-Nearest Neighbor in terms of Bias?
When you decrease the k the bias will be increases
When you increase the k the bias will be increases
Both (A) and (B)
None of the Above
What is Decision Tree?
Flow-Chart
Structure in which internal node represents test on an attribute, each branch represents outcome of test and each leaf node represents class label
Flow-Chart & Structure in which internal node represents test on an attribute, each branch represents outcome of test and each leaf node represents class label
None of the mentioned
_______is a metric to measure how often a randomly chosen element would be incorrectly identified.
Information Gain
Entropy
none of these
Gini Index
Suppose you are working on weather prediction, and your weather station makes one of three predictions for each day’s weather: Sunny, Cloudy or Rainy. You’d like to use a learning algorithm to predict tomorrow’s weather. How would you treat this problem?
Regression
Geographical
Classification
Which is overfitting
Identify whether true or false: In PCA the number of input dimensions is equal to principal components.
True
False
Among the following option identify the one which is used to create the most common graph types.
qplot
plot
quickplot
All of the above
Full form of PAC is _____________
Probably Approximate Cost
Probably Approximate Correct.
Probably Approximate Communication
Probably Approximate Computation
What is the term known as on which the machine learning algorithms build a model based on sample data?
Transfer data
Training data
Data Training
None of the above
regression technique finds out a linear relationship between x (input) and y(output) hence it is called as _________.
Hypothesis function
Related regression
Linear Regression
none of these
K-Means clustering
Conceptual clustering
Agglomerative clustering
All of the above
_____ refers to converting the labels into numeric form so as to convert it into the machine-readable form.
Euclidean Distance
Min-Max Normalization
Minkowski Distance
Label Encoding
Solving queries
Increasing complexity
Decreasing complexity
Answering probabilistic query
Clustering is ___________ and is example of ____________learning
predictive and supervised
predictive and unsupervised
descriptive and supervised
descriptive and unsupervised
Suppose you have trained an anomaly detection system for fraud detection, and your system that flags anomalies when p(x) is less than ε, and you find on the cross-validation set that it is missing many fradulent transactions (i.e., failing to flag them as anomalies). What should you do?
Increase ε
Decrease ε
both a and b
none of these
In Random Forest the Memory requirement for the storage process?
High Memory
Low Memory
No Memory
None of theAbove
___________ refers to a model that can neither model the training data nor generalize to new data.
good fitting
overfitting
underfitting
all of the above
Suppose we would like to convert a nominal attribute X with 4 values to a data table with only binary variables. How many new attributes are needed?
4
8
1
12
The confusion matrix is used when there are two or more classes as the output of the classifier.
True
False
Suppose you have picked the parameter for a model using 10-fold cross validation (CV). Which of the following is the best way to pick a final model to use and estimate its error?
Pick any of the 10 models you built for your model; use its error estimate on the held-out data
Train a new model on the full data set, using the parameter you found; use the average CV error as its error estimate
Average all of the 10 models you got; use the average CV error as its error estimate
Average all of the 10 models you got; use the error the combined model gives on the full training set
The Goal of model tuning is to find a model _______
That is at least 95% accurate on the training data set
That is at the sweet spot between a simple working model and a very complex one
That makes you feel like you are a true machine learning expert
That takes less than 30 minutes to train and validate
Following are the two statements given for k-NN algorIthm, which of the statement(s)
is/are true?
We can choose optimal value of k with the help of cross validation
Euclidean distance treats each feature as equally important
1
2
1 and 2
None of these
Which library is to be imported for creating DataFrame?
Python
DataFrame
Pandas
Random
Case-based
Neural Network
Linear Regression
Support Vector Machines
We can create DataFrame from _____
Numpy arrays
List of Dictionaries
Dictionary of Lists
All of the above
Which of the following parameter is used to specify row or column in rename function of DataFrame?
rowindex
colindex
Both of the above
index
Imagine a Newly-Born starts to learn walking. It will try to find a suitable policy to learn walking after repeated falling and getting up.specify what type of machine learning is best suited?
classification
regression
kmeans algorithm
reinforcement learning
Regularization is used in case of overfitting
True
False
When performing regression or classification, which of the following is the correct way to preprocess the data?
Normalize the data → PCA → training
PCA → normalize PCA output → training
Normalize the data → PCA → normalize PCA output → training
None of the above
The distance between two points calculated using Pythagoras theorem is
supremum distance
eucledian distance
linear distance
manhattan distance
What is the use of this code? print(digits.DESCR)
This will print the description of digits.
print numbers
none of this
How to check missing values in categorical variables
df[categorical].isnull().sum()
df[categorical].isnull()
df[categorical].sum()
df[categorical].null().sum()
What do you understand by this picture output?
(a)
What does this code do?
car['name'] = car['name'].str.split(' ').str.slice(0,3).str.join(' ')
Splitting the name into a list and removing the first two words from the list
Getting the first two words from the name
Splitting the name into the list
None of these
What is the purpose of this code?print('Accuracy: %.3f' % accuracy_score(x_pred, y_test))
print the accuracy
finding the accuracy
accuracy score
none of this
_______is basically a type of unsupervised learning method
Unsupervised learning
clustering
semi supervised
classification
How can we find the number of rows and columns in the data?
dataframe.shape()
dataframe.size()
dataframe.shape
dataframe.size
_______ is an area of Machine Learning in which about taking suitable action to maximize reward in a particular situation.
Supervised learning
unsupervised learning
Reinforcement learning
None of these
Which of the following is required by K- means clustering?
defined distance metric
number of clusters
initial guess as to cluster centroids
all of the mentioned
Application of machine learning methods to large databases is called
data mining.
artificial intelligence
big data computing
internet of things
Regarding bias and variance, which of the following statements are true? (Here ‘high’ and ‘low’ are relative to the ideal model.)
(i). Models which overfit are more likely to have high bias
(ii). Models which overfit are more likely to have low bias
(iii). Models which overfit are more likely to have high variance
(iv). Models which overfit are more likely to have low variance
(i) and (ii)
(ii) and (iii)
(iii) and (iv)
None of these
Which regression is used in the following image?
Linear Regression
Logistic Regression
Polynomial Regression
Ridge Regression
Which type of learning algorithm used for "future crude oil prices "?
Recognizing similarities
predicting
creatind patterns
all the above
What is the purpose of restricting hypothesis space in machine learning?
Can be easier to search
May avoid overfit since they are usually simpler (e.g. linear or low order decision surface)
Both of the above
None of the above
The selling price of a house depends on many factors. For example, it depends on
the number of bedrooms, number of kitchen, number of bathrooms, the year the house was
built, and the square footage of the lot. Given these factors, predicting the selling price of
the house is an example of ____________ task.
Binary Classification
Multilabel Classification
Simple Linear Regression
Multiple Linear Regression
a
b
c
d
State whether the statements are True or False.
Statement A: When the hypothesis space is richer, overfitting is more likely.
Statement B: When the feature space is larger, overfitting is more likely.
False, False
True, False
True, True
False, True
Which of the following methods do we use, to find the best fit line for data in Linear Regression?
Least Square Error
Least Square Error
Logarithmic Loss
Both A and B
The data is split according to a certain requirements
Decision tree learning
Reinforcement learning
Predictive models
sentiment analysis
Several sets of data related to each other used to make decisions in machine learning algorithms. E.g. comments to make you happy and comments to make you sad
Dataset
supervised learning
unsupervised learning
Classifiers
After training the ML model, we see how accurately it predicts the answer/responds. For example – does it cry when I say something mean to it?
Recognition
Training
Predictive models
Testing
Automatic recognition of patterns in data (text, handwriting, images, sound and video)
Recognition
Training
Predictive models
Testing
In Decision Tree, _____ is dividing the root node into different parts on the basis of some condition.
pruning
splitting
leaf node
parent node
Example of Reinforcement learning
chess game
object recognition
Weather conditions
price of house
How do you handle missing or corrupted data in a dataset?
An attribute having high entropy
An attribute having high entropy and Information gain
An attribute having largest information gain
None of the Mentioned
How can we also save the model which we have created.?
(a)
How to choose the value of K in KNN?
Take the square root of the total data point available in the dataset.
Take the mean of the total data point available in the dataset.
Take the variance of the total data point available in the dataset.
Take the standard deviation of the total data point available in the dataset.
KNN algorithm requires
More time for training
More time for testing
Equal time for training and testing
None of the Mentioned
Identify the kind of learning algorithm for “facial identities for facial expressions”.
Prediction
Recognition Patterns
Recognizing anomalies
Generating Patterns
what will be the output of this code?
acc = knn.score(X_test, y_test)
print(f'accuracy from knn.score = {acc:.4}')
from sklearn import metrics
acc = metrics.accuracy_score(y_test, y_pred)
print(f'accuracy from metrics.accuracy_score= {acc:.4}')
print the accuracy and metrics accuracy
print the accuracy from knn and print the accuracy from metric accuracy
both 1 and 2
none of trhese
What is use of this code?
plt.xlabel('Height')
plt.ylabel('Count')
x as height and y as count
show the lable of x as height and y as count
x and y will be height and count
none of the above
What does the GraphViz gives?
GraphViz gives a better and clearer Graph.
GraphViz gives detailed graph
GraphViz gives only given values graph
none of these
what is the use of this code? tree.plot_tree(clf)
We can visualize the tree using tree.plot_tree
We can classify the tree using tree.plot_tree
We can plot the tree using tree.plot_tree
all of these
The selective acquisition of knowledge through the use of manual programs
The selective acquisition of knowledge through the use of computer programs
The autonomous acquisition of knowledge through the use of manual programs
The autonomous acquisition of knowledge through the use of computer programs
Confusion matrix
Cost-sensitive accuracy
Area under the ROC curve
All of the above
Linear, binary
Linear, numeric
Nonlinear, binary
Nonlinear, numeric
Fast
Accuracy
Scalable
All of the above
Poor Data Quality
Lack of skilled resources
Inadequate Infrastructure
None of the above
What is predict () ?
predict() function enables us to predict the labels of the data values on the basis of the trained model.
predict() function enables us to predict the labels on the basis of the trained model.
predict() function enables us to predict the labels
predict() function enables us to predict the labels of the data values on the basis of the tested model.
Language units
Structural units
System constraints
Role structure of units
The way to install the pandas library
install pandas
pandas install python
python install pandas
None of the above
NumPY stands for?
Numbering Python
Number In Python
Numerical Python
None Of the above
Spam Classification is an example for ?
Naive Bayes
Probabilistic condition
Random Forest
All the Above
The Scikit Learn library uses the___ _method to infer the properties of data
extract()
encode()
transform()
classify()
In the given Dataset you need to convert the Price column to an integer value.
How to check number of unique values from each column pandas
nunique()
.unique()
.nunique()
both 1 and 3
During the execution of following code, what will be the response, we get
import pandas as pd
s =pd.Series([1,2,3,4,5],index= ['a','b','c','d','e'])
print(s['f'])
KeyError
IndexError
ValueError
None of the above mentioned
Amongst which of the following can be used to create various inputs using pandas DataFrame.
Lists, dict
Series
Numpy ndarrays and Another DataFrame
All of the above mentioned
in Read CSV Files what is meant by CSV?
comma separated files
copied separated files
comma simple files
none of these
How will you show the relationship between the columns?
import pandas as pd
df = pd.read_csv('data.csv')
print(df.corr())
import pandas as pd
print(df.correlation())
import pandas as pd
df = pd.read_csv('data.csv')
print(df.corre())
all of these
Insert the correct Pandas method to create a DataFrame.
pd. (a) (data)
What is a correct syntax to return the first value of a Pandas Series?
pd.myseries[mylist]
pd.createmyseries[mylist]
pd.getmyseries[mylist]
none of the above
An appropriate chart for visualizing the linear relationship between two variables is ________
Scatter plot
Barchart
Histograms
None of these
With the index argument, you can name your own labels.
yes
no
We can create a NumPy ___________object by using the array() function.
ndarray
nparray
numpyarray
none of these
In NumPy, what does the SHAPE of an array mean?
The shape is the number of columns.
The shape is the number of rows
The shape is the number of elements in each dimension.
all of these
In Decision Tree algorithms entropy of a given dataset is zero. This statement implies____
Further splitting is required
Need some other information to decide splitting
No further splitting is required
None of the Mentioned
what is the use of this code?
remove Veil-type column
remove type column
remove all Veil-type column
none of the above
Find the accuracy of the given confusion matrix?
41%
82%
90%
100%
what is the function of the following code?
y_pred = pipe.predict(X_test)
r2_score(y_test, y_pred)
Predicting and calculating the accuracy of the training model
Return the size training set
Return the size of the testing set
Predicting for test values and calculating the score of prediction
Choose the correct output for following
dec= round(decision_tree.score(x_train, y_train) * 100,2)
Return the sample value
Return the observations
Return the Accuracy
None of these
what are the blues dots in the figure are called___
nodes
data
datapoints
points
hich one is the correct syntax to find the unique values in the Year column from the car dataset?
car['year'].unique==True
car['year']=unique()
car['year'].unique()
car['year']=car.year.unique()
A Machine Learning technique that helps in detecting the outliers in data.what is it called as??
Clustering
Anomaly Detection
Classification
none of these
RGB image is represented by _____ size matrix.
row X column
row X column X 2
row X column X k
row X column X 3
What is the purpose of this code snippet?
movies_df[((movies_df['year'] >= 2010) & (movies_df['year'] <= 2020)) & (movies_df['rating'] > 7.0)
Get the movies which are launched before 2010 and has rating >7.0
Get the movies which are launched before 2010 or has rating >7.0
Get the movies which are launched between 2010-20 and has rating >7.0
Get the movies which are launched between 2010-20 or has rating >7.0
What is the role of Exploratory Data Analysis (EDA) in data analysis?
Making sense of database
To discover patterns
To spot anomalies
All of these
Choose the correct syntax to drop the "veil-Type" column from the mushroom database.
mushroom.drop('veil-type', axis=1, inplace=True)
mushroom.drop(columns=['veil-type'], axis=1, inplace=True)
mushroom.drop(columns=['veil-type'], axis=5, inplace=True)
mushroom.drop(columns=mushroom['veil-type'], axis=1, inplace=True)
what does this code means?
(a)
what does this code means?
Define function to extract titles from passenger names
Define function to take titles from passenger names
Define function to extract titles from data
all of these
train[['Title', 'Survived']].groupby(['Title'], as_index=False).agg(['mean', 'count', 'sum'])
in this code
what does the
mean_____
count_____
sum_____ means?
(a)
In dataset loading, The variables of data are called its?
Response
Features
Target
Vector
Convolution operations are mainly multiplication and addition operations
true
false
How will you check data types in X_train ?
x_train.dtypes
X_train.datatypes
X_train.dtypes
none of these
What is Machine Learning?
(a)
Machine Learning is a subset of _____
Data Learning
Deep Learning
Artificial Intelligence
all of these
How will you find first 3 head in the given picture?
train.head()
train.head(0)
train.head(3)
train.head(2)
What will be the value here?
1
5
0
2
original_train = train.copy()
What is the copy() in this code?
Using 'copy()' allows to clone the dataset, creating a different object with the same values
Using 'copy()' allows to dataset, creating a different object with the same values
Using 'copy()' allows to clone the dataset, creating a different object with the different values
None of these
k-NN algorithm does more computation on test time rather than train time.
A) TRUE B) FALSE
True
False
for var in categorical:
print(df[v0ar].value_counts())
What does this code means?
To view the values
view frequency of categorical variables
view all the values and variables
All of these
Which of the following is true about Manhattan distance?
It can be used for continuous variables
It can be used for categorical variables
It can be used for categorical as well as continuous
None of these
Suppose you have given the following images(1 left, 2 middle and 3 right), Now your task is to find out the value of k in k-NN in each image where k1 is for 1st, k2 is for 2nd and k3 is for 3rd figure.
k1 > k2> k3
k1<k2
k1 = k2 = k3
None of these
Which one of the following will draw a scatter plot showing different colors for a different outlook in clf Dataset.
sns.relplot(data = clf, hue = 'outlook')
sns.relplot(x = 'temp', y = 'humidity',hue = 'outlook')
sns.relplot(x = 'temp', y = 'humidity', data = clf, hue = 'outlook')
sns.relplot(x = 'temp', y = 'humidity', data = clf)
print('Training set score: {:.4f}'.format(logreg.score(X_train, y_train))) print('Test set score: {:.4f}'.format(logreg.score(X_test, y_test)))
What is the use of this code?
print the scores on training and test set
print the scores on training
print the scores on training and test set and format the data
none of these
from sklearn.model_selection import train_test_split X_train, X_test, y_train, y_test = train_test_split(X, y, test_size = 0.2, random_state = 0)
In this code What does its splits ?
select X and Y into testing sets
select X and Y into training sets
split X and Y into testing sets
split X and y into training and testing sets
