Unit 1 - Practice Quiz

CSE273 50 Questions
0 Correct 0 Wrong 50 Left
0/50

1 Which of the following statements best defines Machine Learning?

A. Explicitly programming a computer to solve a specific task without data.
B. A field of study that gives computers the ability to learn without being explicitly programmed.
C. The process of storing massive amounts of data in a database.
D. The hardware optimization of graphical processing units (GPUs).

2 Which of the following represents the correct relationship between Artificial Intelligence (AI), Machine Learning (ML), and Deep Learning (DL)?

A. ML DL AI
B. AI ML DL
C. DL ML AI
D. DL AI ML

3 In the context of Machine Learning types, what characterizes Supervised Learning?

A. The model learns from unlabeled data.
B. The model learns from data that contains input-output pairs (labeled data).
C. The model learns through a system of rewards and penalties.
D. The model generates new data instances similar to the training set.

4 Which of the following is a classic example of Unsupervised Learning?

A. Spam Email Detection
B. House Price Prediction
C. Customer Segmentation (Clustering)
D. Playing Chess (Game AI)

5 Reinforcement Learning is primarily based on:

A. Minimizing the reconstruction error.
B. Maximizing a cumulative reward signal.
C. Predicting a continuous value.
D. Classifying data into fixed categories.

6 What distinguishes a Parametric Model from a Non-parametric Model?

A. Parametric models cannot be used for regression.
B. Parametric models assume a fixed number of parameters independent of the sample size.
C. Non-parametric models do not use any parameters.
D. Parametric models are always slower to train.

7 Which of the following is an example of a Non-parametric algorithm?

A. Linear Regression
B. Logistic Regression
C. K-Nearest Neighbors (KNN)
D. Linear Discriminant Analysis

8 A Discriminative Model attempts to learn:

A. The joint probability distribution
B. The conditional probability distribution
C. The marginal probability
D. The distribution of the input data only

9 Which of the following is a Generative Model?

A. Support Vector Machine (SVM)
B. Logistic Regression
C. Naive Bayes
D. Decision Tree

10 In the standard Machine Learning Workflow, which step typically follows 'Data Preprocessing'?

A. Model Deployment
B. Data Collection
C. Model Training/Selection
D. Problem Definition

11 Why do we split data into Training and Testing sets?

A. To double the size of the dataset.
B. To ensure the model has enough data to learn.
C. To evaluate how well the model generalizes to unseen data.
D. To fix syntax errors in the code.

12 Which of the following is a typical split ratio for Train/Test data?

A. 10% Train, 90% Test
B. 50% Train, 50% Test
C. 80% Train, 20% Test
D. 100% Train, 0% Test

13 When a model performs very well on training data but effectively 'guesses' on test data (high training accuracy, low test accuracy), it is suffering from:

A. Underfitting
B. Overfitting
C. Optimal convergence
D. High Bias

14 Which concept is associated with High Bias?

A. Overfitting
B. Underfitting
C. High Variance
D. Complex decision boundaries

15 The Bias-Variance Trade-off suggests that:

A. Ideally, we want high bias and high variance.
B. Increasing model complexity typically decreases bias but increases variance.
C. Increasing model complexity typically increases bias and decreases variance.
D. Bias and Variance are unrelated concepts.

16 In a Regression problem, which metric is commonly used to evaluate performance?

A. Accuracy
B. F1-Score
C. Mean Squared Error (MSE)
D. Confusion Matrix

17 What is calculated using the formula: ?

A. Precision
B. Recall
C. Accuracy
D. F1 Score

18 Which command is used to import Numpy in Python?

A. import numpy as np
B. include numpy
C. using package numpy
D. from numpy import *

19 What is the output of the following code?
import numpy as np
arr = np.array([1, 2, 3])
print(arr.ndim)

A. 3
B. 1
C. (3,)
D. Array(3)

20 How do you create a 3x3 identity matrix in Numpy?

A. np.identity(3, 3)
B. np.eye(3)
C. np.array([3, 3], type='identity')
D. np.ones((3, 3))

21 Which Numpy function creates an array of evenly spaced values within a given interval?

A. np.space()
B. np.arrange()
C. np.linspace()
D. np.interval()

22 Consider the code: a = np.array([1, 2, 3]) and b = np.array([2, 2, 2]). What is a * b?

A. [2, 4, 6]
B. 12
C. [3, 4, 5]
D. Error

23 What is the requirement for Broadcasting two arrays in Numpy?

A. They must have exactly the same shape.
B. They must have the same number of dimensions.
C. For each dimension, the sizes must be equal or one of them must be 1.
D. Both arrays must be 1-dimensional.

24 If A is an array of shape (4, 1) and B is an array of shape (3,), what is the resulting shape of A + B?

A. (4, 1)
B. (4, 3)
C. (7,)
D. Error: shapes are incompatible

25 Which function performs Matrix Multiplication in Numpy?

A. np.mult()
B. np.dot()
C. np.matrix_multiply()
D. np.cross()

26 To convert a 2D array of shape (3, 4) into a 1D array of shape (12,), which method is used?

A. arr.transpose()
B. arr.reshape(12)
C. arr.flatten()
D. Both B and C

27 What does np.random.rand(2, 3) return?

A. A 2x3 array of random integers.
B. A 2x3 array of random floats sampled from a normal distribution.
C. A 2x3 array of random floats sampled from a uniform distribution over [0, 1).
D. A single random number.

28 Which Numpy attribute is used to find the number of rows and columns of a matrix?

A. .size
B. .shape
C. .dim
D. .length

29 Which of the following is an application of Machine Learning?

A. Recommendation Systems (e.g., Netflix)
B. SQL Database Management
C. Network routing protocols (Traditional)
D. Compiling Java code

30 In the context of evaluating a classification model, what is a False Positive?

A. The model correctly predicts the positive class.
B. The model correctly predicts the negative class.
C. The model incorrectly predicts the positive class (predicts Yes when actual is No).
D. The model incorrectly predicts the negative class (predicts No when actual is Yes).

31 How can you ensure reproducibility of random numbers in Numpy?

A. By running the code multiple times.
B. By using np.random.seed(value).
C. By using np.random.secure().
D. It is impossible to reproduce random numbers.

32 What happens if you try to modify the shape of an array using .reshape() such that the total number of elements changes?

A. It pads the array with zeros.
B. It truncates the array.
C. It raises a ValueError.
D. It creates a new array with random values.

33 Which of the following creates a Numpy array filled with zeros?

A. np.empty((2,2))
B. np.zeros((2,2))
C. np.null((2,2))
D. np.O((2,2))

34 If x = np.array([[1, 2], [3, 4]]), what is x.T?

A. The inverse of the matrix.
B. The transpose of the matrix.
C. The determinant.
D. The flattened array.

35 Which metric is best suited for a classification problem with imbalanced classes?

A. Accuracy
B. Mean Squared Error
C. F1-Score
D. R-squared

36 Which step helps in handling missing values in a dataset?

A. Feature Scaling
B. Data Imputation
C. One-hot encoding
D. Cross-validation

37 What is the purpose of Cross-Validation?

A. To deploy the model.
B. To assess model performance more reliably by using multiple train-test splits.
C. To mix two different datasets.
D. To speed up training.

38 Which of the following is NOT a core component of a Confusion Matrix?

A. True Positive
B. False Negative
C. Mean Absolute Error
D. True Negative

39 Numpy operations are often faster than standard Python lists because:

A. They utilize Vectorization.
B. They run on the cloud.
C. They ignore data types.
D. They are interpreted line by line.

40 What is the range of values returned by np.random.randn()?

A. [0, 1]
B. [-1, 1]
C. following a Standard Normal Distribution
D. All positive integers

41 In the equation , what does represent?

A. The slope
B. The bias term
C. Irreducible Error / Noise
D. The feature vector

42 Semi-supervised learning is a combination of:

A. Supervised and Reinforcement Learning
B. Small amount of labeled data and large amount of unlabeled data
C. Clustering and Regression
D. Parametric and Non-parametric models

43 What does np.argmax(array) return?

A. The maximum value in the array.
B. The index of the maximum value.
C. The sorted array.
D. The mean of the array.

44 Which of the following best describes Regularization?

A. Adding more features to the model.
B. Techniques used to prevent overfitting by penalizing complex models.
C. Cleaning the data using regular expressions.
D. Increasing the learning rate.

45 If arr = np.array([10, 20, 30, 40]), what does arr[1:3] return?

A. array([20, 30])
B. array([10, 20])
C. array([20, 30, 40])
D. array([30])

46 Data Science is considered an interdisciplinary field that includes:

A. Only Computer Science
B. Only Statistics
C. Statistics, Computer Science, and Domain Expertise
D. Only Web Development

47 Which Numpy function calculates the standard deviation?

A. np.mean()
B. np.var()
C. np.std()
D. np.dev()

48 In Machine Learning, a feature vector refers to:

A. The output label.
B. An n-dimensional vector of numerical features that represent some object.
C. The error rate of the model.
D. The Python list containing the library imports.

49 Which type of learning is used for a chess-playing engine that learns by playing millions of games against itself?

A. Supervised Learning
B. Unsupervised Learning
C. Reinforcement Learning
D. Semi-supervised Learning

50 What is the result of np.arange(5)?

A. [1, 2, 3, 4, 5]
B. [0, 1, 2, 3, 4]
C. [0, 1, 2, 3, 4, 5]
D. [5]