0% found this document useful (0 votes)
67 views86 pages

SEC III Artificial Intelligence Question Bank

The document provides an overview of key concepts in Artificial Intelligence (AI) and Machine Learning (ML), including definitions, types of learning (supervised, unsupervised, reinforcement), and various algorithms such as Naive Bayes, Support Vector Machines, and K-Means clustering. It also discusses applications of AI in different industries, advantages and disadvantages of various methods, and common libraries used in Python for implementing these techniques. Overall, it serves as a foundational lecture series on AI and ML principles and practices.

Uploaded by

agarwalnaman445
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
67 views86 pages

SEC III Artificial Intelligence Question Bank

The document provides an overview of key concepts in Artificial Intelligence (AI) and Machine Learning (ML), including definitions, types of learning (supervised, unsupervised, reinforcement), and various algorithms such as Naive Bayes, Support Vector Machines, and K-Means clustering. It also discusses applications of AI in different industries, advantages and disadvantages of various methods, and common libraries used in Python for implementing these techniques. Overall, it serves as a foundational lecture series on AI and ML principles and practices.

Uploaded by

agarwalnaman445
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 86

Unit 1: Lecture 1

1. What is Artificial Intelligence (AI)?

A) The study of computer algorithms that improve automatically through


experience

B) The simulation of human intelligence processes by machines

C) The process of extracting patterns from large datasets

D) The design of systems that mimic animal behavior

Answer: B) The simulation of human intelligence processes by machines

2. Which of the following is NOT a component of AI?

A) Machine Learning

B) Neural Networks

C) Blockchain

D) Natural Language Processing

Answer: C) Blockchain

3. What is Machine Learning (ML)?

A) A subset of AI focused on building systems that learn from data

B) A technology that mimics human emotions

C) A process to design faster processors

D) A type of computer hardware

Answer: A) A subset of AI focused on building systems that learn from data

4. Which of the following best describes supervised learning?

A) The model learns from data without any labeled responses

B) The model is trained on labeled data

C) The model learns by optimizing a fitness function


D) The model operates on symbolic data rather than numerical data

Answer: B) The model is trained on labeled data

5. What type of machine learning is used when the model learns from data that is
neither classified nor labeled?

A) Supervised Learning

B) Unsupervised Learning

C) Reinforcement Learning

D) Semi-supervised Learning

Answer: B) Unsupervised Learning

6. Which of the following is NOT an advantage of Machine Learning?

A) Automation of repetitive tasks

B) High initial setup costs

C) Ability to handle large volumes of data

D) Improvement of outcomes through data analysis

Answer: B) High initial setup costs

7. Which of the following is an application of AI in healthcare?

A) Predictive maintenance

B) Image recognition for disease diagnosis

C) Fraud detection

D) Customer service chatbots

Answer: B) Image recognition for disease diagnosis

8. Which industry heavily uses machine learning for recommendation systems?

A) Agriculture

B) Retail
C) Manufacturing

D) Transportation

Answer: B) Retail

9. How is AI applied in the finance sector?

A) Automated trading

B) Weather prediction

C) Virtual reality gaming

D) Autonomous vehicles

Answer: A) Automated trading

10. In which application is reinforcement learning commonly used?

A) Spam filtering

B) Game playing (e.g., AlphaGo)

C) Sentiment analysis

D) Speech recognition

Answer: B) Game playing (e.g., AlphaGo)

Unit 1: Lecture 2
1. What is the main assumption of the Naive Bayes classifier?

A) The attributes are highly dependent

B) The attributes are equally important

C) The attributes are conditionally independent given the class

D) The attributes are unimportant for classification

Answer: C) The attributes are conditionally independent given the class

2. Which type of data is Naive Bayes particularly good at handling?

A) Continuous data
B) Text data

C) Image data

D) Time-series data

Answer: B) Text data

3. What is a significant disadvantage of the Naive Bayes classifier?

A) It requires a large amount of memory

B) It is computationally intensive

C) It assumes independence among predictors, which is rarely true in real life

D) It does not work well with small datasets

Answer: C) It assumes independence among predictors, which is rarely true in real life

4. What is the objective of a Support Vector Machine (SVM)?

A) To maximize the distance between the decision boundary and the nearest data points of any
class

B) To minimize the number of misclassified points

C) To maximize the number of support vectors

D) To minimize the computational complexity

Answer: A) To maximize the distance between the decision boundary and the nearest data points
of any class

5. What kernel can be used in SVM to handle non-linear data?

A) Linear Kernel

B) Polynomial Kernel

C) Radial Basis Function (RBF) Kernel

D) All of the above

Answer: D) All of the above

6. Which of the following is a disadvantage of SVM?

A) It works well with high-dimensional data


B) It is sensitive to the choice of kernel and regularization parameter

C) It can handle both linear and non-linear data

D) It has a clear geometric interpretation

Answer: B) It is sensitive to the choice of kernel and regularization parameter

7. What is the purpose of a decision tree in machine learning?

A) To create a regression model

B) To split data into subsets based on the value of input attributes

C) To perform clustering

D) To reduce dimensionality

Answer: B) To split data into subsets based on the value of input attributes

8. What is a significant disadvantage of decision trees?

A) They are difficult to interpret

B) They require a lot of data preprocessing

C) They are prone to overfitting

D) They are not suitable for categorical data

Answer: C) They are prone to overfitting

9. Which attribute selection measure is used to calculate the reduction in entropy?

A) Gini Index

B) Information Gain

C) Gain Ratio

D) Chi-Square

Answer: B) Information Gain

10. What does the Gini Index measure?

A) The impurity in a dataset

B) The amount of information gained


C) The statistical significance of attributes

D) The ratio of split points

Answer: A) The impurity in a dataset

Unit 1: Lecture 3
1. What is a Random Forest?

A) A type of neural network

B) An ensemble learning method that uses multiple decision trees

C) A clustering algorithm

D) A linear model

Answer: B) An ensemble learning method that uses multiple decision trees

2. What is the K in K-Nearest Neighbors?

A) The number of classes

B) The number of nearest neighbors to consider for classification

C) The number of features in the dataset

D) The number of layers in the model

Answer: B) The number of nearest neighbors to consider for classification

3. Which of the following is a disadvantage of KNN?

A) It is easy to implement

B) It can handle multi-class classification

C) It is computationally expensive for large datasets

D) It performs well with a small amount of data

Answer: C) It is computationally expensive for large datasets

4. What is a typical application of KNN?

A) Predicting stock prices

B) Image recognition
C) Natural language processing

D) Clustering

Answer: B) Image recognition

5. What is the primary goal of regression analysis?

A) Classify data points

B) Predict continuous values

C) Group data points into clusters

D) Reduce dimensionality

Answer: B) Predict continuous values

6. What is the cost function used in Linear Regression?

A) Entropy

B) Mean Squared Error (MSE)

C) Gini Index

D) Euclidean Distance

Answer: B) Mean Squared Error (MSE)

7. Which assumption is NOT made by Linear Regression?

A) Linearity of relationships

B) Independence of errors

C) Homoscedasticity

D) Data follows a normal distribution

Answer: D) Data follows a normal distribution

8. What type of output does Logistic Regression produce?

A) Continuous values

B) Categorical values
C) Cluster labels

D) Time-series data

Answer: B) Categorical values

9. Which function is used in Logistic Regression to map predicted values to probabilities?

A) Linear function

B) Polynomial function

C) Sigmoid function

D) Logarithmic function

Answer: C) Sigmoid function

10. What is a common application of Logistic Regression?

A) Predicting house prices

B) Classifying emails as spam or not spam

C) Grouping customers based on purchasing behavior

D) Predicting weather patterns

Answer: B) Classifying emails as spam or not spam

Unit 1: Lecture 4
1. What is the primary goal of clustering in machine learning?

A) Predicting continuous values

B) Classifying data points into predefined categories

C) Grouping similar data points together

D) Reducing the dimensionality of data

Answer: C) Grouping similar data points together

2. Which of the following is NOT a type of clustering?


A) Hierarchical clustering

B) Density-based clustering

C) Agglomerative clustering

D) Decision tree clustering

Answer: D) Decision tree clustering

3. In clustering, what is a cluster centroid?

A) The data point that is farthest from the center of the cluster

B) The geometric center of a cluster

C) The point with the highest number of connections

D) The first point assigned to a cluster

Answer: B) The geometric center of a cluster

4. What is the K in K-Means clustering?

A) The number of clusters

B) The number of iterations

C) The number of nearest neighbors

D) The number of features

Answer: A) The number of clusters

5. What is the main objective of the K-Means algorithm?

A) To minimize the sum of squared distances between points and their respective cluster
centroids

B) To maximize the distance between different clusters

C) To minimize the number of clusters

D) To maximize the variance within each cluster

Answer: A) To minimize the sum of squared distances between points and their respective
cluster centroids

6. Which of the following is an advantage of clustering?


A) High interpretability of results

B) Requires labeled data for training

C) Can discover hidden patterns in data without supervision

D) Suitable for all types of data

Answer: C) Can discover hidden patterns in data without supervision

7. What is a disadvantage of K-Means clustering?

A) It is easy to implement

B) It always converges to the global optimum

C) It is sensitive to the initial placement of centroids

D) It works well with all shapes of clusters

Answer: C) It is sensitive to the initial placement of centroids

8. Which of the following is a common application of K-Means clustering?

A) Image compression

B) Predicting stock prices

C) Spam filtering

D) Sentiment analysis

Answer: A) Image compression

9. Which of the following is a disadvantage of clustering?

A) It can handle only numerical data

B) The results can be highly sensitive to the choice of distance metric

C) It requires a lot of labeled training data

D) It is always computationally expensive

Answer: B) The results can be highly sensitive to the choice of distance metric

10. In which scenario would you use clustering?

A) To classify emails as spam or not spam


B) To group customers based on purchasing behavior

C) To predict the price of a house

D) To detect fraud in financial transactions

Answer: B) To group customers based on purchasing behavior

Unit 1: Lecture 5
1. Which of the following is a type of hierarchical clustering?

A) K-Means

B) DBSCAN

C) Agglomerative clustering

D) Mean Shift

Answer: C) Agglomerative clustering

2. Which clustering method is best suited for discovering clusters of arbitrary shape?

A) K-Means

B) DBSCAN

C) Agglomerative clustering

D) K-Medoids

Answer: B) DBSCAN

3. Which of the following is true about K-Means clustering?

A) It is a density-based clustering method

B) It assigns each point to the nearest cluster center

C) It creates a hierarchy of clusters

D) It can handle clusters of varying density

Answer: B) It assigns each point to the nearest cluster center

4. What is a key characteristic of hierarchical clustering?


A) It requires the number of clusters to be specified in advance

B) It can be visualized using a dendrogram

C) It is a partitional clustering method

D) It is always faster than K-Means

Answer: B) It can be visualized using a dendrogram

5. What is anomaly detection?

A) A supervised learning technique to classify data points

B) An unsupervised learning technique to identify rare events or observations

C) A regression technique to predict future data points

D) A clustering technique to group similar data points

Answer: B) An unsupervised learning technique to identify rare events or observations

6. What is a primary application of anomaly detection?

A) Image recognition

B) Fraud detection

C) Market basket analysis

D) Sentiment analysis

Answer: B) Fraud detection

7. What is an advantage of hierarchical clustering over K-Means?

A) It is less computationally expensive

B) It does not require specifying the number of clusters in advance

C) It always finds the global optimum

D) It works better with large datasets

Answer: B) It does not require specifying the number of clusters in advance

8. What is a disadvantage of density-based clustering methods like DBSCAN?

A) It is sensitive to the number of clusters


B) It cannot handle noise in the data

C) It requires specifying density parameters like epsilon and minimum points

D) It assumes clusters are convex

Answer: C) It requires specifying density parameters like epsilon and minimum points

9. What is an application of K-Means clustering?

A) Predicting stock prices

B) Customer segmentation

C) Sentiment analysis

D) Real-time prediction

Answer: B) Customer segmentation

10. Which of the following is an application of anomaly detection?

A) Grouping similar documents

B) Detecting credit card fraud

C) Clustering customers based on purchase history

D) Predicting house prices

Answer: B) Detecting credit card fraud

Unit 1: Lecture 6
1. Which library in Python is commonly used for implementing K-Nearest Neighbors
(KNN)?

A) NumPy

B) SciPy

C) scikit-learn

D) TensorFlow

Answer: C) scikit-learn
2. In KNN, what happens when you increase the value of K?

A) The model becomes more complex and prone to overfitting

B) The model becomes simpler and less prone to overfitting

C) The computational cost decreases

D) The distance between neighbors increases

Answer: B) The model becomes simpler and less prone to overfitting

3. Which function is used to create a KNN classifier in scikit-learn?

A) KNeighborsClassifier()

B) KNeighborsRegressor()

C) KNN()

D) NearestNeighbors()

Answer: A) KNeighborsClassifier()

4. What parameter in KNN determines the distance metric used to find the nearest
neighbors?

A) n_neighbors

B) metric

C) weights

D) algorithm

Answer: B) metric

5. Which of the following is a disadvantage of KNN?

A) It is simple to implement

B) It requires large amounts of memory for storing the entire dataset

C) It does not require any parameter tuning

D) It is non-parametric
Answer: B) It requires large amounts of memory for storing the entire dataset

6. Which library in Python is commonly used for implementing Linear Regression?

A) pandas

B) matplotlib

C) scikit-learn

D) seaborn

Answer: C) scikit-learn

7. Which method is used to fit a linear regression model in scikit-learn?

A) fit()

B) train()

C) predict()

D) apply()

Answer: A) fit()

8. How do you make predictions using a trained KNN model in scikit-learn?

A) model.fit()

B) model.predict()

C) model.train()

D) model.transform()

Answer: B) model.predict()

9. What is a common application of Linear Regression?

A) Classifying images

B) Predicting house prices

C) Clustering customers
D) Detecting anomalies

Answer: B) Predicting house prices

10. How do you insert COMMENTS in Python code?

A) // This is a comment

B) # This is a comment

C) /* This is a comment */

D) <!-- This is a comment -->

Answer: B) # This is a comment

Unit 1: Lecture 7
1. Which Python library is commonly used for implementing K-Means clustering?

A) pandas

B) scikit-learn

C) NumPy

D) TensorFlow

Answer: B) scikit-learn

2. Which function in scikit-learn is used to perform K-Means clustering?

A) KMeansCluster()

B) KMeans()

C) KMeansClustering()

D) ClusterKMeans()

Answer: B) KMeans()

3. What parameter in the KMeans class specifies the number of clusters?

A) n_clusters
B) n_groups

C) clusters

D) groups

Answer: A) n_clusters

4. What method is used to fit a Decision Tree model in scikit-learn?

A) fit()

B) train()

C) predict()

D) apply()

Answer: A) fit()

5. What type of output does Logistic Regression produce?

A) Continuous values

B) Categorical values

C) Cluster labels

D) Time-series data

Answer: B) Categorical values

6. Which method in scikit-learn's LogisticRegression class is used to fit the model?

A) train()

B) fit()

C) predict()

D) apply()

Answer: B) fit()

7. Which Python library is commonly used for implementing Support Vector Machines
(SVM)?
A) pandas

B) scikit-learn

C) NumPy

D) TensorFlow

Answer: B) scikit-learn

8. Which kernel can be used in scikit-learn's SVM implementation?

o A) Linear
o B) Polynomial
o C) Radial Basis Function (RBF)
o D) All of the above

Answer: D) All of the above

9. Which function in scikit-learn is used to split data into training and testing sets?

A) train_test_split()

B) split_data()

C) data_split()

D) train_test()

Answer: A) train_test_split()

10. Which evaluation metric is suitable for classification problems?

A) Mean Squared Error

B) R-squared

C) Accuracy

D) Mean Absolute Error

Answer: C) Accuracy
Lecture 1 : Unit 2

Q.1 Which of the following is not a valid Python data type?

a) int
b) float
c) complex
d) real

Answer: d) real

Q.2 What is the output of the following expression?

10 // 3

a) 3.3333
b) 3
c) 3.0
d) 4

Answer: b) 3

Q.3 What will be the output of the following code?

x = 5
y = 10
x += y
print(x)

a) 5
b) 10
c) 15
d) 50

Answer: c) 15

Q.4 Which of the following operators is used for string concatenation in Python?

a) *
b) &
c) +
d) #

Answer: c) +
Q.5 What will be the output of the following code?

x = "Hello"
y = 'World'
print(x + y)

a) Hello World
b) HelloWorld
c) Hello+World
d) Error

Answer: b) HelloWorld

Q.6 What will be the result of the following expression?

5 % 2

a) 2
b) 1
c) 0
d) 5

Answer: b) 1

Q.7 What will be the output of the following code?

print(2 ** 3)

a) 5
b) 6
c) 8
d) 9

Answer: c) 8

Q.8 Which of the following is the correct way to declare a variable and assign the value 10 to it in
Python?

a) int x = 10
b) x = 10
c) x := 10
d) int x := 10

Answer: b) x=10
Q.9 Which of the following methods can be used to convert a string to an integer in Python?

a) int()
b) str()
c) float()
d) ord()

Answer: b) str()

Q.10 What will be the result of the following expression?

4 + 3 * 2

a) 14
b) 10
c) 8
d) 7

Answer: b) 10

Lecture 2 : Unit 2
Q.1 What does the // operator do in Python?

A) Division

B) Multiplication

C) Floor Division

D) Modulus

Answer: C) Floor Division


Q.2 Which arithmetic operator is used to find the remainder of the division?

A) +

B) -

C) %

D) *

Answer: C) %

Q.3 What will be the output of the following code?

x=5

if x > 3:

print("Hello")

else:

print("Goodbye")

A) Hello
B) Goodbye
C) Error
D) Nothing

Answer: A) Hello

Q. 4 What is the purpose of the elif statement?

A) To handle multiple conditions

B) To end an if statement

C) To repeat a block of code

D) To define a function

Answer: A) To handle multiple conditions


Q. 5 Which of the following is a valid if statement in Python?

A) if x = 5:

B) if (x == 5)

C) if x == 5:

D) if (x = 5):

Answer: C) if x == 5:

Q.6 Which of the following can be used to check multiple conditions in an if statement?

A) if-else

B) if-elif-else

C) switch-case

D) while-loop

Answer: B) if-elif-else

Q.7 How do you check for inequality in an if statement?

A) x =! y

B) x == y

C) x != y

D) x < y

Answer: C) x != y
Q.8 What will be the output of the following code?

x=0

if x:

print("True")

else:

print("False")

A) True

B) False

C) Error

D) Nothing

Answer: B) False

Q.9 How can you execute a block of code if a condition is false?

A) Using else statement

B) Using elif statement

C) Using if statement

D) Using then statement

Answer: A) Using else statement

Q.10 How do you write a conditional expression in Python?

A) if x = 5

B) if x: 5

C) if x == 5

D) if x equals 5

Answer: C) if x == 5
Lecture 3 : Unit 2
Q.1 Which of the following is true about nested if-else statements?

a) They can only be used within loops.

b) They allow multiple conditions to be checked.

c) They cannot be used in Python.

d) They are the same as switch-case statements in other languages.

Answer: b) - They allow multiple conditions to be checked.

Q.2 What is the output of the following code?

x = 15

if x > 10:

if x > 20:

print("x is greater than 20")

else:

if x == 15:

print("x is 15")

a) x is greater than 20

b) x is 15

c) No output

d) Syntax error

Answer: b) x is 15

Q.3 Which of the following is the correct syntax for nested if-else in Python?

a) if condition1: if condition2: statement


b) if condition1: condition2: statement

c) if condition1: { if condition2: statement }

d) if condition1: [ if condition2: statement ]

Answer: a) if condition1: if condition2: statement

Q.4 Which of the following is false about nested if-else?

a) It helps to check multiple conditions.

b) It increases the readability of code.

c) It can lead to deeply nested structures.

d) It is equivalent to using multiple if statements independently.

Answer: d) It is equivalent to using multiple if statements independently.

Q.5 What will be the output of the following code?

x = -10

if x > 0:

if x % 2 == 0:

print("Positive even")

else:

print("Positive odd")

else:

if x % 2 == 0:

print("Negative even")

else:

print("Negative odd")

a) Positive even
b) Positive odd

c) Negative even

d) Negative odd

Answer: c) Negative even

Q.6 Which statement can be used to terminate a while loop prematurely?

a) break

b) continue

c) exit

d) terminate

Answer: a) break

Q.7 What does the following code do?

x=5

while x > 0:

x -= 1

if x == 2:

break

print(x, end=' ')

a) 4 3 2 1 0
b) 4 3 2
c) 4 3
d) 5 4 3
Answer: c) 4 3
Q.8 What will happen if the condition in a while loop never becomes False?

a) The loop will run infinitely

b) The loop will run only once

c) The loop will not run

d) The program will crash

Answer: a) The loop will run infinitely

Q.9 Which of the following is correct syntax for a while loop?

a) while x = 5:

b) while x == 5

c) while (x == 5):

d) while x == 5:

Answer: d) while x == 5:

Q.10 Which of the following will execute a while loop 10 times?

a) x = 0 while x < 10: print(x)

b) x = 0 while x <= 10: print(x)

c) x = 0 while x < 10: print(x) x += 1

d) x = 1 while x < 10: print(x) x += 1

Answer: c) x = 0 while x < 10: print(x) x += 1


Lecture 4 : Unit 2
Q.1 How can you iterate through a set s using a for loop?

A. for i in s:

B. for i in range(s):

C. foreach i in s:

D. for each i in s:

Answer: A

Q,2 What is the correct syntax to use a for loop to print each item in the list fruits?

A. for fruit in fruits: print(fruit)

B. for fruit of fruits: print(fruit)

C. for fruit in fruits { print(fruit) }

D. foreach fruit in fruits: print(fruit)

Answer: A

Q.3 Which function is used to create a sequence of numbers in a for loop?

A. sequence()

B. range()

C. list()

D. set()

Answer: B

Q.4 What is the correct syntax for a for loop in Python to iterate over a list named
numbers?

A. for i in range(numbers):

B. for i in numbers:
C. foreach i in numbers:

D. for each i in numbers:

Answer: B

Q. 5 What is the output of the following code?

for i in range(5, 8):

print(i)

A. 5 6 7 8
B. 5 6 7
C. 6 7 8
D. 5 6

Answer: B

Q. 6 What is the output of the following code?

for i in range(2, 10, 2):

print(i)

A. 2 3 4 5 6 7 8 9
B. 2 4 6 8
C. 2 4 6 8 10
D. 2 4 6

Answer: B

Q. 7 What is the output of the following code?

for i in range(1, 5):

if i == 3:

break

print(i)

A. 1 2 3
B. 1 2
C. 1 2 3 4
D. 1 2 4
Answer: B
Q. 8 What is the output of the following code?

for i in range(3):

for j in range(2):

print(i, j)

A. (0, 1) (1, 1) (2, 1)


B. (0, 0) (0, 1) (1, 0) (1, 1) (2, 0) (2, 1)
C. (0, 0) (1, 0) (2, 0)
D. (1, 1) (2, 2) (3, 3)

Answer: B

Q.9 How can you iterate through a set s using a for loop?

A. for i in s:

B. for i in range(s):

C. foreach i in s:

D. for each i in s:

Answer: A

Q. 10 What is the output of the following code?

for i in range(2):

for j in range(3):

print(i + j)

A. 0 1 2 1 2 3
B. 0 1 2 1 2 3 4
C. 0 1 2 1 2 3
D. 0 1 2 0 1 2

Answer: D
Unit 2: Lecture 5
Q.1 What is the correct syntax to define a function in Python?

A. function myFunction():

B. def myFunction():

C. define myFunction():

D. function: myFunction()

Answer: B

Q.2 Which of the following is the correct way to call a function named calculate with no
arguments?

A. calculate;

B. calculate[];

C. calculate();

D. call calculate();

Answer: C

Q.3 What is the default return value of a function in Python if no return statement is used?

A. 0

B. None

C. False

D. ''

Answer: B

Q.4 What is the purpose of the return statement in a function?

A. To end the function execution

B. To pass control to the caller of the function


C. To return a value to the caller

D. To define a new function

Answer: C

Q.5 What is the correct way to define a function that takes no parameters and returns no
value?

A. def func(): pass

B. def func() return None

C. function func() { return; }

D. def func() {}

Answer: A

Q. 6 What will be the output of the following code?

def add(x, y=10):


return x + y
print(add(5))

A. 15

B. 5

C. 10

D. x + y

Answer: A
Q.7 Which of the following is true about function parameters in Python?

A. Parameters can only be positional

B. Parameters can only be keyword

C. Parameters can be both positional and keyword

D. Parameters must always have default values

Answer: C

Q.8 Which of the following is true about the return statement in Python?

A. It can return multiple values

B. It can return only one value

C. It is optional

D. Both A and C

Answer: D

Q. 9 What will be the output of the following code?

def func(a, b):


return a < b
print(func(5, 3))

A. False

B. True

C. None
D. Error

Answer: A

Q.10 Which of the following is true about a function in Python?

A. A function can only have one return statement

B. A function cannot call another function

C. A function can return multiple values

D. A function must always have parameters

Answer: C

Unit 2: Lecture 6

Q. 1 Which of the following is the correct syntax to create an empty list in Python?

A) my_list = {}

B) my_list = []

C) my_list = ()

D) my_list = None

Answer: B) my_list = []

Q,2 Which method adds an element to the end of a list?

A) append()

B) add()

C) insert()

D) extend()

Answer: A) append()
Q.3 Which method would you use to remove an element at a specific index in a list?

A) remove()

B) delete()

C) pop()

D) discard()

**Answer: C) pop()

Q. 4 Which of the following list methods returns the index of the first occurrence of a
value?

A) find()

B) search()

C) index()

D) locate()

**Answer: C) index()

Q. 5 If my_list = [3, 1, 4, 1, 5], what does my_list.count(1) return?

A) 0

B) 1

C) 2

D) 3

**Answer: C) 2
Q. 6 Which of the following is the correct syntax to create an empty tuple in Python?

A) my_tuple = {}

B) my_tuple = []

C) my_tuple = ()

D) my_tuple = None

Answer: C) my_tuple = ()

Q. 7 How can you access the first element of a tuple named my_tuple?

A) my_tuple[first]

B) my_tuple[0]

C) my_tuple[1]

D) my_tuple[-1]

**Answer: B) my_tuple[0]

Q. 8 Which of the following methods is available for tuples?

A) append()

B) insert()

C) remove()

D) count()

**Answer: D) count()
Q. 9 What will be the result of the following code: my_tuple = (1, 2, 3); my_tuple[1] =
10?

A) (1, 10, 3)

B) [1, 10, 3]

C) TypeError

D) IndexError

**Answer: C) TypeError

Q. 10 Which of the following statements is true about tuples in Python?

A) Tuples are mutable.

B) Tuples can contain elements of different data types.

C) Tuples cannot be nested.

D) Tuples are slower than lists.

Answer: B) Tuples can contain elements of different data types.

Unit-3 Lecture -1

1. What is the first step in data processing?

A. Data analysis

B. Data collection

C. Data visualization

D. Data cleaning

ANS: B. Data collection


2. Which of the following is an example of categorical data?

A. Height in centimeters

B. Temperature in Fahrenheit

C. Eye color

D. Age in years

ANS: C. Eye color

3. What type of data is best represented by a continuous variable?

A. Nominal data

B. Ordinal data

C. Interval data

D. Ratio data

ANS: D. Ratio data

4. Which type of data includes values that are ordered but not equally spaced?

A. Nominal

B. Ordinal

C. Interval

D. Ratio

ANS: B. Ordinal

5. In which of the following areas is machine learning commonly applied?

A. Medical diagnosis

B. Stock market prediction

C. Speech recognition

D. All of the above


ANS: D. All of the above

6. Which machine learning technique is used for making predictions based on


historical data?

A. Clustering

B. Classification

C. Regression

D. Dimensionality reduction

ANS: C. Regression

7. Why is data normalization important in machine learning?

A. It increases the size of the dataset

B. It speeds up the data collection process

C. It ensures all features contribute equally to the model

D. It reduces the number of features in the dataset

ANS: C. It ensures all features contribute equally to the model

8. Which of the following is an advantage of automated data processing?

A. It eliminates all data errors

B. It speeds up the data analysis process

C. It requires no human intervention

D. It reduces data variability

ANS: B. It speeds up the data analysis process

9. What is a potential drawback of using complex data processing techniques?

A. They are always accurate

B. They require less data

C. They can be computationally expensive


D. They simplify the data

ANS: C. They can be computationally expensive

10. Which of the following is a benefit of data visualization?

A. It simplifies the data cleaning process

B. It helps in understanding complex data patterns

C. It eliminates the need for data preprocessing

D. It automatically improves data quality

ANS: B. It helps in understanding complex data patterns

Unit -3

Lecture- 2

1. What are Scikit-Learn used for?

A. Data visualization

B. Web development
C. Machine learning

D. Text processing

ANS: C. Machine learning

2. Which function is used to split a dataset into training and testing sets in Scikit-
Learn?

A. split_train_test()

B. train_test_split()

C. split_dataset()

D. dataset_split()

ANS: B. train_test_split()

3. SciPy is primarily used for which of the following?

A. Machine learning

B. Statistical computations

C. Data visualization

D. Web scraping

ANS: B. Statistical computations

4. What is the purpose of Matplotlib?

A. Data preprocessing

B. Data analysis

C. Data visualization

D. Data cleaning

ANS: C. Data visualization


5. Which of the following is a characteristic of the Iris dataset?

A. It contains 1000 samples.

• B. It has 10 features.
• C. It includes species of flowers as the target variable.
• D. It is used for image recognition.

ANS: C. It includes species of flowers as the target variable.

6. What is the target variable in the Diabetes dataset from Scikit-Learn?

• A. Blood pressure
• B. Body mass index (BMI)
• C. Disease progression after one year
• D. Age

ANS: C. Disease progression after one year

7. What does the Optical recognition of handwritten digits dataset contain?

A. Images of handwritten letters

B. Images of handwritten digits

C. Audio recordings of spoken digits

D. Video clips of handwritten digits

ANS: B. Images of handwritten digits

8. What does the train_test_split() function return by default?

A. Two arrays: one for training data and one for testing data

B. Three arrays: one for training data, one for testing data, and one for validation data

C. Four arrays: training data, test data, training labels, and test labels

D. One array: combined training and testing data

ANS: C. Four arrays: training data, test data, training labels, and test labels
9. Which parameter in train_test_split() controls the proportion of the dataset to
include in the test split?

A. test_size

B. train_size

C. random_state

D. shuffle

ANS: A. test_size

10. How can you ensure reproducibility when using train_test_split()?

A. By setting the test_size parameter

B. By setting the train_size parameter

C. By setting the random_state parameter

D. By setting the shuffle parameter

ANS: C. By setting the random_state parameter

Unit-3_Lecture3
1. Which Python library is used to load the data frame in a 2D array format and
has multiple functions to perform analysis tasks?

1. Numpy
2. Pandas
3. Matplotlib
4. Seaborn

Answer: 2. Pandas

2. How can bogus values in a categorical column be identified in a dataset?

1. Using the dropna() method


2. Using the difference method
3. Using the unique() method
4. Using the strip() method

Answer: 2. Using the difference method

3. What is the main purpose of using seaborn and matplotlib libraries?

1. Data loading
2. Numerical computations
3. Data visualization
4. Data cleaning

Answer: 3. Data visualization

4. How can you remove rows with NULL values from a DataFrame?

1. Using the replace() method


2. Using the dropna() method
3. Using the fillna() method
4. Using the remove() method

Answer: 2. Using the dropna() method

5. When handling inconsistent categorical data, which method is used to convert


all characters to lower case?

1. str.upper()
2. str.lower()
3. str.title()
4. str.strip()
Answer: 2. str.lower()

6. Which of the following is NOT a type of bad data that needs cleaning?

1. Empty cells
2. Data in correct format
3. Wrong data
4. Duplicates

Answer: 2. Data in correct format

7. Which pandas method can be used to remove rows or columns with missing
values?

1. dropna()
2. fillna()
3. replace()
4. interpolate()

Answer: 1. dropna()

8. Which of the following is a reason for removing duplicates in a dataset?

1. To increase data redundancy


2. To make the dataset more interpretable
3. To improve model performance by removing redundant data
4. To change the data format

Answer: 3. To improve model performance by removing redundant data

9. Which library in Python is primarily used for data manipulation and analysis,
especially for handling tabular data?

1. Scikit-learn
2. Matplotlib
3. Pandas
4. Numpy

Answer: 3. Pandas

10. What is the primary goal of data cleaning?

1. To increase the dataset size


2. To fix bad data in the dataset
3. To add more features
4. To reduce the number of columns
Answer: 2. To fix bad data in the dataset

Unit – 3

Lecture -4

1. Which method is used to replace missing values in a DataFrame with the mean
value of a column?

1. replace()
2. dropna()
3. fillna()
4. interpolate()

Answer: 3. fillna()

2. What value is used to replace missing values when using the mode method in
data preprocessing?

1. The average value of the column


2. The value in the middle after sorting all values ascending
3. The most frequently occurring value in the column
4. The maximum value of the column

Answer: 3. The most frequently occurring value in the column

3. What value is used to replace missing values when using the median method in
data preprocessing?

1. The average value of the column


2. The value in the middle after sorting all values ascending
3. The most frequently occurring value in the column
4. The minimum value of the column

Answer: 2. The value in the middle after sorting all values ascending

4. Which pandas method is used to convert a column of dates into a standard date
format?

1. to_date()
2. to_datetime()
3. strftime()
4. strptime()
Answer: 2. to_datetime()

5. How can you remove rows with NULL values after converting a column to a
standard date format?

1. df.dropna(subset=['Date'], inplace=True)
2. df.replace(to_datetime(), inplace=True)
3. df.fillna(subset=['Date'], inplace=True)
4. df.drop(columns=['Date'], inplace=True)

Answer: 1. df.dropna(subset=['Date'], inplace=True)

6. Which of the following is a common method for handling cells with wrong data
formats?

1. Removing the entire row


2. Leaving them as is
3. Adding more columns
4. Ignoring the issue

Answer: 1. Removing the entire row

7. What method can be used to remove duplicate rows in a DataFrame?

1. dropna()
2. drop_duplicates()
3. fillna()
4. replace()

Answer: 2. drop_duplicates()

8. Which encoding method is used to convert categorical labels into numeric form?

1. One-Hot Encoding
2. Label Encoding
3. Standard Scaling
4. Min-Max Scaling

Answer: 2. Label Encoding

9. Which method is used to replace missing values with the most frequently
occurring value in a column?

1. fillna(mode())
2. replace(mode())
3. fillna(x.mode())
4. fillna(x.mode()[0])

Answer: 4. fillna(x.mode()[0])

10. Which of the following is NOT a common step in data preprocessing?

1. Handling missing values


2. Encoding categorical data
3. Increasing the number of rows
4. Detecting and removing duplicates

Answer: 3. Increasing the number of rows

Unit - 3

Lecture -5
1. Which library in Python is commonly used for data manipulation and analysis?

A) NumPy

B) Pandas

C) Matplotlib

D) Scikit-learn

Answer: B) Pandas

2. Which Python library is primarily used for scientific computing and handling large multi-
dimensional arrays and matrices?

A) Pandas

B) SciPy

C) NumPy

D) TensorFlow

Answer: C) NumPy

3. Which Python library would you use for creating static, interactive, and animated visualizations?
A) Seaborn

B) Matplotlib

C) Plotly

D) Bokeh

Answer: B) Matplotlib

4. Which library is used for machine learning and provides simple and efficient tools for data
mining and data analysis?

A) TensorFlow

B) Keras

C) Scikit-learn

D) Theano

Answer: C) Scikit-learn

5. Which library provides high-level neural networks API, written in Python and capable of
running on top of TensorFlow, CNTK, or Theano?

A) Keras

B) PyTorch

C) Caffe

D) MXNet

Answer: A) Keras

6. Which Python library is designed for data visualization and is based on Matplotlib but provides
a higher-level interface for drawing attractive and informative statistical graphics?

A) Matplotlib

B) Seaborn

C) Plotly

D) Bokeh

Answer: B) Seaborn
7. Which library is used for numerical optimization, integration, interpolation, eigenvalue
problems, and other advanced mathematical operations?

A) NumPy

B) SciPy

C) Matplotlib

D) Pandas

Answer: B) SciPy

8. Which library provides an easy interface for creating static, interactive, and animated
visualizations in Python?

A) Matplotlib

B) Plotly

C) Seaborn

D) Pandas

Answer: B) Plotly

9. Which library is used for machine learning in Python?

A) TensorFlow

B) Matplotlib

C) NumPy

D) Flask

Answer: A) TensorFlow

10. Which library would you use to work with data visualization specifically designed for
statistical graphics in Python?

A) Matplotlib

B) Seaborn

C) Pandas

D) SciPy
Answer: B) Seaborn

Unit – 3

Lecture – 6

1. Which function in the Pandas library is used to display the first few rows of a DataFrame?

A) .head()
B) .tail()
C) .info()
D) .describe()

Answer: A) .head()

2. Which method in Pandas provides a summary of statistics pertaining to the DataFrame


columns?

A) .head()
B) .describe()
C) .info()
D) .value_counts()

Answer: B) .describe()

3. Which method would you use to check for missing values in a DataFrame?

A) .isnull()
B) .dropna()
C) .fillna()
D) .notnull()

Answer: A) .isnull()

4. In Matplotlib, which function is used to create a basic line plot?

A) plt.bar()
B) plt.plot()
C) plt.hist()
D) plt.scatter()

Answer: B) plt.plot()

5. Which Seaborn function is used to create a correlation heatmap?


A) sns.barplot()
B) sns.heatmap()
C) sns.scatterplot()
D) sns.distplot()

Answer: B) sns.heatmap()

6. Which Pandas function is used to get the unique values of a column?

A) .value_counts()
B) .unique()
C) .nunique()
D) .drop_duplicates()

Answer: B) .unique()

7. Which Pandas method provides a quick overview of the DataFrame, including the number of
non-null entries and the data type of each column?

A) .head()
B) .tail()
C) .info()
D) .describe()

Answer: C) .info()

8. In Matplotlib, which function is used to create a bar chart?

A) plt.plot()
B) plt.hist()
C) plt.bar()
D) plt.scatter()

Answer: C) plt.bar()

9. Which function in Pandas is used to read a CSV file?

A) pd.read_csv()
B) pd.read_excel()
C) pd.read_json()
D) pd.read_table()

Answer: A) pd.read_csv()

10. Which function in Matplotlib is used to create a histogram?


A) plt.plot()
B) plt.hist()
C) plt.bar()
D) plt.scatter()

Answer: B) plt.hist()

Unit 3 : Lecture – 7
Question 1: Which library is primarily used for data manipulation and analysis
in Python?

A) NumPy
B) SciPy
C) Matplotlib
D) Pandas

Answer: D) Pandas

Question 2: Which Python library is most commonly used for numerical


computing and handling arrays?

A) Pandas
B) NumPy
C) Seaborn
D) TensorFlow

Answer: B) NumPy

Question 3: Which library provides functions for scientific and technical


computing such as optimization, integration, and interpolation?

A) NumPy
B) SciPy
C) Matplotlib
D) Pandas

Answer: B) SciPy
Question 4: Which library is widely used for data visualization in Python,
offering a wide range of static, animated, and interactive plots?

A) Seaborn
B) Bokeh
C) Matplotlib
D) Plotly

Answer: C) Matplotlib

Question 5: Which function in Matplotlib is used to create a line plot?

A) plt.bar()
B) plt.scatter()
C) plt.plot()
D) plt.line()

Answer: C) plt.plot()

Question 6: Which of the following libraries can be used to create scatter plots in
Python?

A) Matplotlib
B) Seaborn
C) Plotly
D) All of the above

Answer: D) All of the above

Question 7: Which Matplotlib function is used to create a bar plot?

A) plt.plot()
B) plt.bar()
C) plt.hist()
D) plt.scatter()

Answer: B) plt.bar()

Question 8: Which parameter in plt.plot() can be used to specify the color of the
line?

A) linestyle
B) linewidth
C) color
D) marker
Answer: C) color

Question 9: Which Python library is used for working with large multi-
dimensional arrays and matrices, and includes a large collection of mathematical
functions?

A) Pandas
B) NumPy
C) SciPy
D) TensorFlow

Answer: B) NumPy

Question 10: Which library is used for interactive visualizations and dashboards
in Python?

A) Matplotlib
B) Seaborn
C) Plotly
D) ggplot

Answer: C) Plotly

Unit 4 : Lectur 1
Q.1 What is the correct syntax to define a function in Python?

A. function myFunction():

B. def myFunction():

C. define myFunction():

D. function: myFunction()

Answer: B

Q.2 Which of the following is the correct way to call a function named calculate with no
arguments?

A. calculate;

B. calculate[];

C. calculate();
D. call calculate();

Answer: C

Q.3 What is the default return value of a function in Python if no return statement is used?

A. 0

B. None

C. False

D. ''

Answer: B

Q.4 What is the purpose of the return statement in a function?

A. To end the function execution

B. To pass control to the caller of the function

C. To return a value to the caller

D. To define a new function

Answer: C

Q.5 What is the correct way to define a function that takes no parameters and returns no
value?

A. def func(): pass

B. def func() return None

C. function func() { return; }

D. def func() {}

Answer: A

Q. 6 What will be the output of the following code?

def add(x, y=10):


return x + y
print(add(5))

A. 15

B. 5

C. 10

D. x + y

Answer: A

Q.7 Which of the following is true about function parameters in Python?

A. Parameters can only be positional

B. Parameters can only be keyword

C. Parameters can be both positional and keyword

D. Parameters must always have default values

Answer: C

Q.8 Which of the following is true about the return statement in Python?

A. It can return multiple values

B. It can return only one value

C. It is optional

D. Both A and C
Answer: D

Q. 9 What will be the output of the following code?

def func(a, b):


return a < b
print(func(5, 3))

A. False

B. True

C. None

D. Error

Answer: A

Q.10 Which of the following is true about a function in Python?

A. A function can only have one return statement

B. A function cannot call another function

C. A function can return multiple values

D. A function must always have parameters

Answer: C

Unit 4 : Lecture 2
1. Which method is used to replace missing values in a Data Frame with the mean
value of a column?

5. replace()
6. dropna()
7. fillna()
8. interpolate()

Answer: 3. fillna()

2. What value is used to replace missing values when using the mode method in
data preprocessing?

5. The average value of the column


6. The value in the middle after sorting all values ascending
7. The most frequently occurring value in the column
8. The maximum value of the column

Answer: 3. The most frequently occurring value in the column

3. What value is used to replace missing values when using the median method in
data preprocessing?

5. The average value of the column


6. The value in the middle after sorting all values ascending
7. The most frequently occurring value in the column
8. The minimum value of the column

Answer: 2. The value in the middle after sorting all values ascending

4. Which pandas method is used to convert a column of dates into a standard date
format?

5. to_date()
6. to_datetime()
7. strftime()
8. strptime()

Answer: 2. to_datetime()

5. How can you remove rows with NULL values after converting a column to a
standard date format?

5. df.dropna(subset=['Date'], inplace=True)
6. df.replace(to_datetime(), inplace=True)
7. df.fillna(subset=['Date'], inplace=True)
8. df.drop(columns=['Date'], inplace=True)

Answer: 1. df.dropna(subset=['Date'], inplace=True)

6. Which of the following is a common method for handling cells with wrong data
formats?

5. Removing the entire row


6. Leaving them as is
7. Adding more columns
8. Ignoring the issue

Answer: 1. Removing the entire row

7. What method can be used to remove duplicate rows in a DataFrame?

5. dropna()
6. drop_duplicates()
7. fillna()
8. replace()

Answer: 2. drop_duplicates()

8. Which encoding method is used to convert categorical labels into numeric form?

5. One-Hot Encoding
6. Label Encoding
7. Standard Scaling
8. Min-Max Scaling

Answer: 2. Label Encoding

9. Which method is used to replace missing values with the most frequently
occurring value in a column?

5. fillna(mode())
6. replace(mode())
7. fillna(x.mode())
8. fillna(x.mode()[0])

Answer: 4. fillna(x.mode()[0])

10. Which of the following is NOT a common step in data preprocessing?

5. Handling missing values


6. Encoding categorical data
7. Increasing the number of rows
8. Detecting and removing duplicates

Answer: 3. Increasing the number of rows

Unit 4 : Lecture 3

1.Which of the following is NOT a classification metric?

• A) Accuracy
• B) Precision
• C) Recall
• D) Mean Squared Error

Correct Answer: D

2.What does precision measure in a classification problem?

• A) The proportion of correctly identified positives out of all positive predictions


• B) The proportion of actual positives correctly identified
• C) The ratio of false positives to total negatives
• D) The overall correctness of the model

Correct Answer: A

3.In a binary classification problem, which of the following refers to true


positives?

• A) Instances correctly classified as negative


• B) Instances incorrectly classified as positive
• C) Instances correctly classified as positive
• D) Instances incorrectly classified as negative

Correct Answer: C
4.Which metric is the most appropriate for imbalanced classification
problems?

• A) Accuracy
• B) Precision
• C) Recall
• D) F1-Score

Correct Answer: D

5.What does a confusion matrix show?

• A) Accuracy of a model
• B) Precision and recall values
• C) True Positives, False Positives, True Negatives, False Negatives
• D) The likelihood of an error in the model

Correct Answer: C

6.Which metric considers both false positives and false negatives equally?

• A) Precision
• B) Accuracy
• C) Recall
• D) F1-Score

Correct Answer: B

7.In a classification problem, if the model always predicts the majority class,
which metric will likely be high?

• A) Precision
• B) Recall
• C) Accuracy
• D) F1-Score

Correct Answer: C

8.What does a high F1-Score indicate?


• A) High precision and low recall
• B) A balance between precision and recall
• C) High accuracy
• D) High recall and low precision

Correct Answer: B

9.Which metric is least useful when dealing with highly imbalanced classes?

• A) Accuracy
• B) F1-Score
• C) Precision
• D) Recall

Correct Answer: A

10.In the context of a confusion matrix, what does the term 'False Positive' refer
to?

• A) The model correctly predicts a positive class


• B) The model incorrectly predicts a positive class
• C) The model correctly predicts a negative class
• D) The model incorrectly predicts a negative class

Correct Answer: B

Unit 4 : Lecture 4

1.Which of the following metrics can take negative values?


A) R-squared

B) Adjusted R-squared

C) MAE

D) MSE

Answer: B

2.Which metric is typically used in conjunction with R-squared to assess the quality of a
regression model?

A) RMSE

B) Mean Squared Error (MSE)

C) Adjusted R-squared

D) Mean Absolute Error (MAE)

Answer: C

3.What does it mean if the R-squared value is high, but the RMSE is also high?

A) The model is overfitted

B) The independent variable perfectly predicts the dependent variable

C) The model is inconsistent

D) The model is poorly fitted but explains variance well

Answer: D

4.When comparing models, a lower RMSE value indicates:

A) A better model

B) A worse model

C) Overfitting
D) High variance

Answer: A

5.If the residuals in a regression model are normally distributed, which metric is more
reliable?

A) Mean Squared Error (MSE)

B) Mean Absolute Error (MAE)

C) Median Absolute Error

D) Adjusted R-squared

Answer: A

6.What is the primary difference between MAE and MSE?

A) MSE squares the residuals while MAE does not

B) MAE penalizes large errors more than MSE

C) MAE is not used in linear regression

D) MSE is always smaller than MAE

Answer: A

7.Which of the following metrics would be most appropriate for comparing two regression
models with different numbers of predictors?

A) R-squared

B) Adjusted R-squared
C) MSE

D) RMSE

Answer: B

8.Which of the following metrics is robust to outliers in regression analysis?

A) Mean Squared Error (MSE)

B) Mean Absolute Error (MAE)

C) R-squared

D) Root Mean Squared Error (RMSE)

Answer: B

9.Which regression metric is most sensitive to outliers?

A) Mean Absolute Error (MAE)

B) R-squared

C) Mean Squared Error (MSE)

D) Adjusted R-squared

Answer: C

10.Which of the following regression metrics measures the average squared difference
between actual and predicted values?

A) R-squared
B) Mean Absolute Error (MAE)

C) Mean Squared Error (MSE)

D) Root Mean Squared Error (RMSE)

Answer: C

Unit 4 : Lecture 5

1.What is the purpose of the train_test_split function in Scikit-learn?

a) To train machine learning models


b) To split data into training and testing sets
c) To evaluate model performance
d) To preprocess data

Ans- b) To split data into training and testing sets

2.Which library in Python provides the train_test_split function?

a) NumPy
b) Pandas
c) Scikit-learn
d) TensorFlow

Ans- c) Scikit-learn
3.Which of the following combinations can be used to split data using train_test_split?

a) features and labels


b) only features
c) labels only
d) data without labels

Ans- a) features and labels

4.What is the purpose of K-fold cross-validation?

A) To test the model on unseen data only

B) To randomly shuffle the dataset

C) To evaluate a model's performance by dividing the dataset into K subsets

D) To select the best hyperparameters for a model

Correct answer: C

5.In K-fold cross-validation, what does "K" refer to?

A) The number of features in the dataset

B) The number of folds into which the dataset is divided

C) The number of rows in the training set

D) The number of models to be evaluated

Correct answer: B

6.How many times does the model train in 5-fold cross-validation?


A) 2 times

B) 5 times

C) 10 times

D) 1 time

Correct answer: B

7.What is the main purpose of the leave-one-out cross-validation (LOOCV) technique?

A) Data augmentation

B) Model evaluation

C) Feature selection

D) Data preprocessing

Correct Answer: B) Model evaluation

8.How many iterations are performed in LOOCV for a dataset with n samples?

A) 1

B) n-1

C) n

D) n/2

Correct Answer: C) n

9.What is the purpose of holdout validation in machine learning?


A) To reduce overfitting

B) To optimize hyperparameters

C) To split the dataset into training and testing sets

D) To improve the accuracy of the model

Answer: C

10.In holdout validation, how many times is the model trained and tested?

A) Once

B) Twice

C) Ten times

D) As many as needed

Answer: A

Unit – 5

Assignment – 1

Question 1: What is Google Colab primarily used for?

A) Writing HTML and CSS code

B) Writing and executing Python code in a Jupyter notebook environment

C) Creating presentations and slideshows


D) Managing databases

Answer: B) Writing and executing Python code in a Jupyter notebook environment

Question 2: Which of the following programming languages is natively supported


by Google Colab?

A) Java

B) Python

C) Ruby

D) C++

Answer: B) Python

Question 3: Which of the following is true about Google Colab's GPU and TPU
support?

A) Only GPUs are supported

B) Only TPUs are supported

C) Both GPUs and TPUs are supported

D) Neither GPUs nor TPUs are supported

Answer: C) Both GPUs and TPUs are supported

Question 4: Which file format is used to save Google Colab notebooks?

A) .txt
B) .docx
C) .ipynb
D) .xlsx

Answer: C) .ipynb

Question 5: Which of the following features is NOT available in Spyder?

A) Integrated debugger

B) Variable Explorer
C) Built-in Git support

D) Integrated web browser

Answer: D) Integrated web browser

Question 6: Which Python library is required to enable the variable explorer and
data visualization in Spyder?

A) NumPy

B) SciPy

C) Pandas

D) Matplotlib

Answer: C) Pandas

Question 7: What is the purpose of the "Help" pane in Spyder?

A) To display the file directory

B) To provide documentation for Python functions and objects

C) To manage Git repositories

D) To compile Java code

Answer: B) To provide documentation for Python functions and objects

Question 8: What is Orange primarily used for?

A) Creating websites

B) Data visualization and analysis

C) Video editing

D) Word processing

Answer: B) Data visualization and analysis

Question 9: What is the main interface of Orange called, where users can create
data workflows?
A) Dashboard

B) Canvas

C) Editor

D) Terminal

Answer: B) Canvas

Question 10: Which widget in Orange is used for visualizing relationships


between variables in a dataset?

A) Heatmap

B) Scatter Plot

C) Box Plot

D) Data Table

Answer: B) Scatter Plot

Unit – 5

Assignment – 2
Question 1: What is the first step in starting an AI project?

A) Collecting data
B) Defining the problem
C) Selecting algorithms
D) Training the model

Answer: B) Defining the problem

Question 2: What is the purpose of exploratory data analysis (EDA) in an AI


project?

A) To clean the data


B) To understand the data distribution and patterns
C) To select the right algorithm
D) To deploy the model

Answer: B) To understand the data distribution and patterns

Question 3: Which of the following is a common practice for handling missing


data in an AI project?

A) Ignoring missing data


B) Filling with the mean or median value
C) Deleting the entire dataset
D) Using random values

Answer: B) Filling with the mean or median value

Question 4: What is the importance of setting a baseline model in an AI project?

A) To finalize the model architecture


B) To have a reference point for evaluating improvements
C) To deploy the model
D) To collect more data

Answer: B) To have a reference point for evaluating improvements

Question 5: What is the main goal of model evaluation in an AI project?

A) To clean the data


B) To ensure the model performs well on new, unseen data
C) To collect more data
D) To deploy the model
Answer: B) To ensure the model performs well on new, unseen data

Question 6: What is the primary purpose of monitoring an AI model after


deployment?

A) To ensure data quality


B) To track the model's performance and identify any issues
C) To retrain the model
D) To collect more data

Answer: B) To track the model's performance and identify any issues

Question 7: Which of the following is essential for an AI project?

A) Data
B) Colors
C) Fonts
D) Animations

Answer: A) Data

Question 8: What is the purpose of training a model?

A) To generate data
B) To find patterns in data
C) To visualize data
D) To clean data

Answer: B) To find patterns in data

Question 9: What is the primary purpose of collecting data in an AI project?

A) To fill storage
B) To train the model
C) To create charts
D) To decorate reports

Answer: B) To train the model

Question 10: After training an AI model, what is an important next step before
deployment?

A) Ignoring results
B) Writing reports
C) Model evaluation
D) Data collection

Answer: C) Model evaluation

Unit 5 : Lecture 3

Question 1: What is Google Colab primarily used for?

A) Writing HTML and CSS code

B) Writing and executing Python code in a Jupyter notebook environment

C) Creating presentations and slideshows

D) Managing databases

Answer: B) Writing and executing Python code in a Jupyter notebook environment

Question 2: Which of the following programming languages is natively supported


by Google Colab?

A) Java

B) Python

C) Ruby

D) C++

Answer: B) Python

Question 3: Which of the following is true about Google Colab's GPU and TPU
support?

A) Only GPUs are supported

B) Only TPUs are supported


C) Both GPUs and TPUs are supported

D) Neither GPUs nor TPUs are supported

Answer: C) Both GPUs and TPUs are supported

Question 4: Which file format is used to save Google Colab notebooks?

A) .txt
B) .docx
C) .ipynb
D) .xlsx

Answer: C) .ipynb

Question 5: Which of the following features is NOT available in Spyder?

A) Integrated debugger

B) Variable Explorer

C) Built-in Git support

D) Integrated web browser

Answer: D) Integrated web browser

Question 6: Which Python library is required to enable the variable explorer and
data visualization in Spyder?

A) NumPy

B) SciPy

C) Pandas

D) Matplotlib

Answer: C) Pandas

Question 7: What is the purpose of the "Help" pane in Spyder?

A) To display the file directory

B) To provide documentation for Python functions and objects


C) To manage Git repositories

D) To compile Java code

Answer: B) To provide documentation for Python functions and objects

Question 8: What is Orange primarily used for?

A) Creating websites

B) Data visualization and analysis

C) Video editing

D) Word processing

Answer: B) Data visualization and analysis

Question 9: What is the main interface of Orange called, where users can create
data workflows?

A) Dashboard

B) Canvas

C) Editor

D) Terminal

Answer: B) Canvas

Question 10: Which widget in Orange is used for visualizing relationships


between variables in a dataset?

A) Heatmap

B) Scatter Plot

C) Box Plot

D) Data Table

Answer: B) Scatter Plot


Unit 5 : Lecture 4

Question 1: What is the first step in starting an AI project?

A) Collecting data
B) Defining the problem
C) Selecting algorithms
D) Training the model

Answer: B) Defining the problem

Question 2: What is the purpose of exploratory data analysis (EDA) in an AI


project?

A) To clean the data


B) To understand the data distribution and patterns
C) To select the right algorithm
D) To deploy the model

Answer: B) To understand the data distribution and patterns

Question 3: Which of the following is a common practice for handling missing


data in an AI project?

A) Ignoring missing data


B) Filling with the mean or median value
C) Deleting the entire dataset
D) Using random values

Answer: B) Filling with the mean or median value

Question 4: What is the importance of setting a baseline model in an AI project?

A) To finalize the model architecture


B) To have a reference point for evaluating improvements
C) To deploy the model
D) To collect more data
Answer: B) To have a reference point for evaluating improvements

Question 5: What is the main goal of model evaluation in an AI project?

A) To clean the data


B) To ensure the model performs well on new, unseen data
C) To collect more data
D) To deploy the model

Answer: B) To ensure the model performs well on new, unseen data

Question 6: What is the primary purpose of monitoring an AI model after


deployment?

A) To ensure data quality


B) To track the model's performance and identify any issues
C) To retrain the model
D) To collect more data

Answer: B) To track the model's performance and identify any issues

Question 7: Which of the following is essential for an AI project?

A) Data
B) Colors
C) Fonts
D) Animations

Answer: A) Data

Question 8: What is the purpose of training a model?

A) To generate data
B) To find patterns in data
C) To visualize data
D) To clean data

Answer: B) To find patterns in data

Question 9: What is the primary purpose of collecting data in an AI project?

A) To fill storage
B) To train the model
C) To create charts
D) To decorate reports
Answer: B) To train the model

Question 10: After training an AI model, what is an important next step before
deployment?

A) Ignoring results
B) Writing reports
C) Model evaluation
D) Data collection

Answer: C) Model evaluation

Unit 5 : Lecture 5

Q.1 How can you iterate through a set s using a for loop?

A. for i in s:

B. for i in range(s):

C. foreach i in s:

D. for each i in s:

Answer: A

Q,2 What is the correct syntax to use a for loop to print each item in the list fruits?

A. for fruit in fruits: print(fruit)

B. for fruit of fruits: print(fruit)

C. for fruit in fruits { print(fruit) }

D. foreach fruit in fruits: print(fruit)

Answer: A

Q.3 Which function is used to create a sequence of numbers in a for loop?

A. sequence()
B. range()

C. list()

D. set()

Answer: B

Q.4 What is the correct syntax for a for loop in Python to iterate over a list named
numbers?

A. for i in range(numbers):

B. for i in numbers:

C. foreach i in numbers:

D. for each i in numbers:

Answer: B

Q. 5 What is the output of the following code?

for i in range(5, 8):

print(i)

A. 5 6 7 8
B. 5 6 7
C. 6 7 8
D. 5 6

Answer: B

Q. 6 What is the output of the following code?

for i in range(2, 10, 2):

print(i)

A. 2 3 4 5 6 7 8 9
B. 2 4 6 8
C. 2 4 6 8 10
D. 2 4 6

Answer: B
Q. 7 What is the output of the following code?

for i in range(1, 5):

if i == 3:

break

print(i)

A. 1 2 3
B. 1 2
C. 1 2 3 4
D. 1 2 4
Answer: B

Q. 8 What is the output of the following code?

for i in range(3):

for j in range(2):

print(i, j)

A. (0, 1) (1, 1) (2, 1)


B. (0, 0) (0, 1) (1, 0) (1, 1) (2, 0) (2, 1)
C. (0, 0) (1, 0) (2, 0)
D. (1, 1) (2, 2) (3, 3)

Answer: B

Q.9 How can you iterate through a set s using a for loop?

A. for i in s:

B. for i in range(s):

C. foreach i in s:

D. for each i in s:

Answer: A
Q. 10 What is the output of the following code?

for i in range(2):

for j in range(3):

print(i + j)

A. 0 1 2 1 2 3
B. 0 1 2 1 2 3 4
C. 0 1 2 1 2 3
D. 0 1 2 0 1 2

Answer: D

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy