0% found this document useful (0 votes)
11 views

ai ml unit 3

The document provides an overview of various machine learning concepts, focusing on classification techniques such as K-Nearest Neighbors, Decision Trees, Naïve Bayes, and Support Vector Machines. It includes key definitions, algorithms, and evaluation metrics used in classification, as well as the differences between classification and regression. Additionally, it addresses common challenges like overfitting, class imbalance, and the importance of choosing appropriate parameters and metrics for model evaluation.

Uploaded by

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

ai ml unit 3

The document provides an overview of various machine learning concepts, focusing on classification techniques such as K-Nearest Neighbors, Decision Trees, Naïve Bayes, and Support Vector Machines. It includes key definitions, algorithms, and evaluation metrics used in classification, as well as the differences between classification and regression. Additionally, it addresses common challenges like overfitting, class imbalance, and the importance of choosing appropriate parameters and metrics for model evaluation.

Uploaded by

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

1.

Introduction to Classification

1. What is classification in machine learning?

o a) Predicting categorical labels ✅

o b) Predicting continuous values

o c) Clustering data

o d) Reducing dimensionality

2. Which of the following is NOT a classification algorithm?

o a) K-Means ✅

o b) K-Nearest Neighbors (KNN)

o c) Decision Tree

o d) Naïve Bayes

3. What is the key difference between classification and regression?

o a) Classification predicts discrete labels, while regression predicts continuous


values ✅

o b) Classification works only with text data

o c) Regression is a type of unsupervised learning

o d) Classification is only used in deep learning

4. What is the purpose of a confusion matrix in classification?

o a) To evaluate the performance of a classifier ✅

o b) To reduce the number of features

o c) To perform regression analysis

o d) To generate synthetic data

5. What is precision in classification?

o a) The ratio of true positives to the sum of true positives and false positives ✅

o b) The ratio of true negatives to total instances

o c) The fraction of correctly predicted positive instances


o d) The difference between actual and predicted values

2. K-Nearest Neighbors (KNN)

6. K-Nearest Neighbors (KNN) is classified as a:

o a) Instance-based learning algorithm ✅

o b) Parametric algorithm

o c) Deep learning model

o d) Reinforcement learning technique

7. How does KNN classify a new data point?

o a) By finding the most common class among the k nearest neighbors ✅

o b) By calculating decision boundaries

o c) By training a neural network

o d) By creating decision trees

8. What happens when the value of K in KNN is too large?

o a) The model becomes less flexible and may underfit ✅

o b) The model overfits the data

o c) The model ignores new data points

o d) The model stops working

9. What is the best way to choose the optimal K value in KNN?

o a) Using cross-validation ✅

o b) Random selection

o c) Using a fixed value of K=10

o d) Increasing K indefinitely

10. What type of distance metric is commonly used in KNN?

 a) Euclidean distance ✅

 b) Cosine similarity
 c) Manhattan distance

 d) Jaccard distance

3. Decision Tree Classifier

11. Decision trees work by:

 a) Splitting data based on feature values ✅

 b) Assigning weights to features

 c) Calculating probability distributions

 d) Using backpropagation

12. What is a leaf node in a decision tree?

 a) A node that represents a class label ✅

 b) The starting node

 c) A node that splits into two

 d) A randomly selected node

13. What is overfitting in decision trees?

 a) When the model is too complex and learns noise ✅

 b) When the model is too simple

 c) When the model performs well on new data

 d) When the tree has too few nodes

14. What is entropy in a decision tree?

 a) A measure of uncertainty in the dataset ✅

 b) The number of branches in a tree

 c) The height of the tree

 d) The count of decision nodes

15. Which algorithm is commonly used to construct decision trees?

 a) ID3 ✅
 b) K-Means

 c) Gradient Boosting

 d) PCA

4. Naïve Bayes Classifier

16. What assumption does Naïve Bayes make?

 a) Features are independent ✅

 b) Features are dependent

 c) Data is linearly separable

 d) The dataset is balanced

17. Naïve Bayes is based on which theorem?

 a) Bayes' theorem ✅

 b) Pythagorean theorem

 c) Markov property

 d) Euclidean distance

18. What is the advantage of Naïve Bayes?

 a) Works well with small datasets ✅

 b) Requires a lot of training data

 c) Only works with numerical data

 d) Ignores missing values

19. In text classification, Naïve Bayes is commonly used because:

 a) It handles high-dimensional data well ✅

 b) It does not require labeled data

 c) It works only with binary data

 d) It needs a deep learning model

20. What is Laplace smoothing in Naïve Bayes?


 a) A technique to handle zero probabilities ✅

 b) A way to improve accuracy

 c) A method to reduce variance

 d) A feature selection technique

5. Support Vector Machine (SVM)

21. What is the key idea behind SVM?

 a) Finding the best hyperplane that separates classes ✅

 b) Calculating mean values

 c) Creating decision trees

 d) Generating random clusters

22. What is a support vector in SVM?

 a) A data point closest to the decision boundary ✅

 b) The largest dataset sample

 c) A random point in the dataset

 d) The center of a cluster

23. What kernel function is commonly used in SVM for non-linear classification?

 a) Radial Basis Function (RBF) ✅

 b) Linear kernel

 c) Manhattan kernel

 d) Euclidean kernel

24. What does a soft-margin SVM do?

 a) Allows some misclassification to avoid overfitting ✅

 b) Only works with linearly separable data

 c) Uses deep learning

 d) Reduces dataset size


25. Which parameter controls the margin in SVM?

 a) C (Regularization parameter) ✅

 b) K (Neighbors)

 c) Entropy

 d) Tree depth

6. Regression (Linear & Polynomial)

26. What is linear regression used for?

 a) Predicting continuous values ✅

 b) Predicting categorical values

 c) Reducing dimensionality

 d) Clustering data

27. What is the equation for simple linear regression?

 a) y = mx + b ✅

 b) y = a + bx²

 c) y = x / 2

 d) y = log(x)

28. What is the difference between polynomial and linear regression?

 a) Polynomial regression fits a curve, linear regression fits a straight line ✅

 b) Polynomial regression is faster

 c) Linear regression requires more data

 d) They are the same

29. What is R-squared in regression?

 a) A measure of how well the model fits the data ✅

 b) The sum of squared errors

 c) The correlation coefficient


 d) The dataset size

30. What is multicollinearity in regression?

 a) When predictor variables are highly correlated ✅

 b) When the dataset is too large

 c) When data has missing values

 d) When classification is used instead of regression

31. Which evaluation metric is most appropriate for imbalanced classification problems?

 a) F1-score ✅

 b) Accuracy

 c) Mean Squared Error

 d) R-squared

32. What is the ROC curve used for?

 a) To visualize the performance of a classification model ✅

 b) To select the best K value in KNN

 c) To measure regression accuracy

 d) To determine the optimal number of clusters

33. In binary classification, what does a high recall value indicate?

 a) The model correctly identifies most positive instances ✅

 b) The model is very specific

 c) The model always predicts "negative"

 d) The model has low accuracy

34. What is a common way to handle class imbalance in a dataset?

 a) Oversampling the minority class ✅

 b) Removing the majority class

 c) Reducing the dataset size

 d) Ignoring the imbalance


35. Which of the following is a probabilistic classification algorithm?

 a) Naïve Bayes ✅

 b) Decision Tree

 c) KNN

 d) SVM

32. K-Nearest Neighbors (KNN)

36. What happens when K=1 in KNN?

 a) The model becomes highly sensitive to noise (overfitting) ✅

 b) The model becomes more generalized

 c) The model ignores distance

 d) The model cannot classify data

37. What is the time complexity of KNN for prediction?

 a) O(n) ✅

 b) O(log n)

 c) O(1)

 d) O(n²)

38. Which distance metric is NOT commonly used in KNN?

 a) Jaccard similarity ✅

 b) Euclidean distance

 c) Manhattan distance

 d) Minkowski distance

39. How can we speed up KNN classification?

 a) Using KD-trees or Ball-trees ✅

 b) Reducing the training set

 c) Increasing the K value indefinitely


 d) Removing labels from the dataset

40. Which library is commonly used for implementing KNN in Python?

 a) Scikit-learn ✅

 b) TensorFlow

 c) PyTorch

 d) Pandas

33. Decision Trees

41. Which criterion is commonly used to split nodes in Decision Trees?

 a) Gini impurity or entropy ✅

 b) R-squared

 c) Euclidean distance

 d) Cosine similarity

42. What is pruning in decision trees?

 a) Removing unnecessary branches to prevent overfitting ✅

 b) Adding more branches to improve accuracy

 c) Reducing the dataset size

 d) Changing decision thresholds

43. How does a random forest improve over a single decision tree?

 a) By averaging multiple trees to reduce overfitting ✅

 b) By using only a single feature for classification

 c) By increasing depth indefinitely

 d) By selecting only one training sample

44. Which of the following is a major limitation of Decision Trees?

 a) They tend to overfit on small datasets ✅

 b) They cannot handle categorical data


 c) They do not work with missing values

 d) They require deep learning

45. What is the main advantage of using Decision Trees?

 a) They are easy to interpret and understand ✅

 b) They always achieve 100% accuracy

 c) They require less data preprocessing

 d) They work only with large datasets

34. Naïve Bayes

46. What is the main assumption of Naïve Bayes?

 a) Features are conditionally independent given the class ✅

 b) Features are dependent

 c) Classes are equally distributed

 d) All data points are equally important

47. Why is Naïve Bayes commonly used for spam detection?

 a) It performs well on high-dimensional text data ✅

 b) It ignores probability distributions

 c) It requires deep learning

 d) It only works on numerical data

48. Which type of Naïve Bayes classifier is best suited for text classification?

 a) Multinomial Naïve Bayes ✅

 b) Gaussian Naïve Bayes

 c) Bernoulli Naïve Bayes

 d) Logistic Regression

49. When does Naïve Bayes perform poorly?

 a) When features are highly correlated ✅


 b) When the dataset is large

 c) When the dataset is balanced

 d) When using numerical features

50. How is probability calculated in Naïve Bayes?

 a) Using Bayes’ theorem ✅

 b) Using K-means clustering

 c) Using gradient descent

 d) Using entropy reduction

51. Which type of learning is classification?

 a) Supervised learning ✅

 b) Unsupervised learning

 c) Reinforcement learning

 d) Semi-supervised learning

52. What is stratified sampling in classification?

 a) Ensuring each class is proportionally represented in training and test sets ✅

 b) Randomly selecting data points

 c) Increasing dataset size

 d) Using a single training sample

53. What happens if a classification model has high bias?

 a) It underfits the data ✅

 b) It overfits the data

 c) It has high accuracy

 d) It performs well on test data

54. What is a One-vs-All (OvA) approach in multi-class classification?

 a) Training a separate binary classifier for each class ✅

 b) Combining all classes into a single label


 c) Using deep learning

 d) Ignoring minority classes

55. What is the impact of an imbalanced dataset in classification?

 a) The model may favor the majority class ✅

 b) The model performs better

 c) It reduces overfitting

 d) It improves generalization

52. K-Nearest Neighbors (KNN)

56. How is the decision boundary in KNN defined?

 a) By the nearest neighbors' class labels ✅

 b) By a fixed linear function

 c) By entropy

 d) By a hyperplane

57. Which of the following is a drawback of KNN?

 a) It is slow for large datasets ✅

 b) It requires a lot of training

 c) It cannot handle numerical data

 d) It only works for regression

58. What effect does increasing K have on KNN?

 a) It smooths decision boundaries ✅

 b) It increases overfitting

 c) It ignores test data

 d) It reduces bias

59. Which technique can help reduce computational cost in KNN?

 a) KD-trees ✅
 b) Increasing dataset size

 c) Ignoring distances

 d) Removing test data

60. What is the best value of K in KNN?

 a) Depends on the dataset and should be chosen using cross-validation ✅

 b) Always 5

 c) Always 1

 d) Any odd number

53. Decision Trees

61. What is the stopping criterion in decision trees?

 a) When further splitting does not improve purity ✅

 b) When all features are used

 c) When entropy is maximized

 d) When dataset size is reduced

62. How does a decision tree handle missing values?

 a) By estimating based on other feature values ✅

 b) By ignoring missing values

 c) By stopping training

 d) By removing all data points with missing values

63. What is information gain in decision trees?

 a) The reduction in entropy after a split ✅

 b) The depth of the tree

 c) The size of the dataset

 d) The learning rate

64. Which method can help prevent overfitting in decision trees?


 a) Pruning ✅

 b) Increasing tree depth

 c) Using all features

 d) Using linear regression

65. What is a major limitation of decision trees?

 a) They are prone to overfitting on small datasets ✅

 b) They cannot handle categorical data

 c) They are too simple

 d) They cannot be interpreted

54. Naïve Bayes

66. What is the main limitation of Naïve Bayes?

 a) It assumes feature independence, which is not always true ✅

 b) It cannot handle text data

 c) It requires large datasets

 d) It only works with numerical data

67. Which Naïve Bayes variant is best for binary classification?

 a) Bernoulli Naïve Bayes ✅

 b) Multinomial Naïve Bayes

 c) Gaussian Naïve Bayes

 d) Logistic Regression

68. Why is Naïve Bayes fast compared to other classifiers?

 a) It does not require complex training ✅

 b) It uses deep learning

 c) It ignores feature distributions

 d) It always predicts the majority class


69. How does Naïve Bayes handle continuous data?

 a) Using Gaussian (Normal) distribution assumption ✅

 b) By converting it to categorical data

 c) By ignoring it

 d) By using decision trees

70. What happens if Naïve Bayes encounters a zero probability for a category?

 a) It applies Laplace smoothing ✅

 b) It ignores the category

 c) It stops predicting

 d) It increases the dataset size

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