Alg for Machine Learning Quiz 3 Prep

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/68

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 2:53 PM on 4/7/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

69 Terms

1
New cards

KNN Algorithm Type

Instance-based

2
New cards

Euclidean Distance Formula

d = sqr(sum(xi-yi)^2))

3
New cards

Manhattan Distance Formula

| x1 - x2 | + | y1 - y2 |

4
New cards

Minkowski Distance Formula

d = (sum(|xi-yi|^p)^(1/p)

5
New cards

KKN Steps

- Compute distance to all points

- Sort distances

- Select k nearest

- Majority vote based on k nearest

6
New cards

What is K in KNN?

Number of neighbors used for voting

7
New cards

Effect of small K in KKN

High Variance & Overfitting

8
New cards

Effect of large K in KKN

High bias & Underfitting

9
New cards

What is KNN's main flaw?

The curse of dimensionality

10
New cards

Curse of Dimensionality

High-dimensional data requires more samples

11
New cards

Normalization Formula

(x - min) / (max - min)

12
New cards

Cosine Similarity Formula

cos(theta) = (x * y)/||x||||y||

13
New cards

Jaccard Similarity Formula

J(A,B) = | A intersection B |/| A union B |

14
New cards

How to calculate Hamming Distance

Count the number of differing positions

15
New cards

In what type of sets will KNN perform poorly?

- High dimensional Data

- Large dataset

- Sets with unscaled features

16
New cards

What is the purpose of Support Vector Machines

Finding the best separating hyperplane / margin between classification classes in a model

17
New cards

SVM Decision Boundary Formula

(w^T)x + b = 0

18
New cards

What is the margin in SVM?

The distance between the boundary and closest points

19
New cards

SVM Margin Formula

2/||w||

20
New cards

What are the 3 SVM Optimization Formulas

- Hard Margin

- Soft Margin

- Hinge Loss

21
New cards

Hard Margin Formula

min(1/2)||w||^2

22
New cards

Soft Margin Formula

(min(1/2)∣∣w∣∣^2) + C∑ξi

23
New cards

Hinge Loss Formula

L = max(0,1 − y((w^T)x + b))

24
New cards

What does the parameter C control in SVM?

Margin vs misclassification tradeoff

25
New cards

What affects can you expect in SVM when parameter C is small?

- Largin margin

- Large amount of errors

26
New cards

What affects can you expect in SVM when parameter C is large?

- Small margin

- Few errors

27
New cards

SVM Kernel Trick Purpose

Transforms data to higher dimensions

28
New cards

SVM Kernel Trick Formula

K(x,z) = ϕ(x) ⋅ ϕ(z)

29
New cards

Guassian RBF Formula

K(x,l) = exp(−γ∣∣x−l∣∣^2)

30
New cards

What is the expected outcome of a large Gamma(Y) In Guassian RBF?

Overfitting & Wiggly Boundary

31
New cards

What is the expected outcome of a small Gamma(Y) In Guassian RBF?

Underfitting & Smooth boundaries

32
New cards

What kind of algorithm is Naive Bayes

Probabilistic Classifier

33
New cards

Steps of Naive Bayes

- Compute prior P(c)

- Compute likelihoods

- Multiply

- Choose max

34
New cards

Gaussian NB Formula

P(x∣c) = (1/sqr(2πσ^2))e^(-(x-y)^2/2σ^2

35
New cards

What are the assumptions when using Gaussian NB?

- Independent Features

- Gaussian for continuous

36
New cards

What type of algorithm is SOFTMAX Regression?

Multi-Class Classification

37
New cards

What algorithm is SOFTMAX Regression a version of?

Logistic Regression

38
New cards

What does SOFTMAX produce?

- Outputs from range sum to 1

- Probabilities

39
New cards

What is the assumption when using SOFTMAX?

Classes are mutually exclusive

40
New cards

SOFTMAX Net Input Z Formula

Z = XW + b

41
New cards

Cross-Entropy Formula

-sum(ylog(yhat))

42
New cards

How to calculate total parameters in SOFTMAX Regression?

(features * classes) + classes

43
New cards

What are odd K's used in KNN

To avoid ties

44
New cards

What is the most common distance formula in KNN?

Euclidean

45
New cards

In KNN what happens if one feature has much larger values than others?

The large value dominates the distance

46
New cards

What technique in KNN is used to reduce dimensionality?

PCA

47
New cards

What is the angle-based distance metric in KNN?

Cosine

48
New cards

What property is not required for Minkowski Distance metric?

Linearity

49
New cards

In the Minkowski Distance formula what value give Manhattan Distance?

1

50
New cards

In the Minkowski Distance formula what value give Euclidean Distance?

2

51
New cards

What are support vectors ins SVM?

Closest points to boundary that determine the hyperplane

52
New cards

What does hinge loss penalize?

Points that are inside margin or have been misclassified

53
New cards

What happens if Naive Bayes encounters a feature value not seen in training?

Probability becomes zero

54
New cards

Laplace Smoothing

Technique to handle zero probabilities in classification

55
New cards

What assumption is made in Naive Bayes

Features are independent

56
New cards

What happens if Naive Bayes assumption is violated?

Accuracy may decrease

57
New cards

In softmax, what happens if one logit is much larger?

That class gets probability ≈ 1

58
New cards

What models are most sensitive to unscaled features?

- KNN

- SVM

59
New cards

What happens when features are not scaled in SVM?

Margin becomes skewed

60
New cards

What kernel maps to infinite-dimensional space

RBF

61
New cards

What happens if a probability becomes zero in Naive Bayes?

Entire product becomes zero

62
New cards

What does Naive Bayes produce?

Multiple probabilities of classes

63
New cards

What is the distribution assumption of GNB?

Normal Distribution

64
New cards

What are the required parameters of GNB

- mean

- variance

65
New cards

What type of features is GNB used on?

Continuous Features

66
New cards

NB Normalized Term

P(X)

67
New cards

NB Prior Class

P(Y)

68
New cards

NB Likelihood

P(X|Y)

69
New cards

NB Posterior

P(Y|X)