Data Science Lecture 7

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

1/118

encourage image

There's no tags or description

Looks like no tags are added yet.

119 Terms

1
New cards

Which statement best describes a binary classification model?

A model that assigns each observation to one of two possible classes.

2
New cards

In a binary classification problem, the response variable usually takes which form?

A variable with two possible outcomes, often coded as 0 and 1.

3
New cards

A logistic regression model for binary classification most directly estimates:

The probability that an observation belongs to the positive class.

4
New cards

Why are predicted probabilities useful in binary classification?

They allow decision makers to select different thresholds based on costs and objectives.

5
New cards

Which example is most naturally a binary classification problem?

Predicting whether an email is spam or not spam.

6
New cards

In a medical screening model, which class is often treated as the positive class?

The condition of interest, such as disease present.

7
New cards

A confusion matrix compares:

Predicted classes with actual classes

8
New cards

A true positive occurs when:

The actual class is positive and the predicted class is positive.

9
New cards

A false negative occurs when:

The model predicts negative for an actual positive case.

10
New cards

Suppose TP = 40, TN = 50, FP = 10, and FN = 20. How many observations are in the sample?

120

11
New cards

For an actual negative observation, which two confusion matrix outcomes are possible?

TN or FP

12
New cards

Changing the probability cut-off affects the confusion matrix because:

The predicted labels may change when probabilities are converted into classes.

13
New cards

Accuracy is defined as:

(TP + TN)/(TP + TN + FP + FN)

14
New cards

Sensitivity, also called recall or true positive rate, is:

TP/(TP + FN)

15
New cards

Specificity is:

TN/(TN + FP)

16
New cards

Precision, also called positive predictive value, is:

TP/(TP + FP)

17
New cards

Which metric is usually most directly concerned with minimizing missed positive cases?

Sensitivity

18
New cards

If the threshold is lowered, which result is generally expected?

More predicted positive cases.

19
New cards

A high false positive rate means:

Many actual negative cases are incorrectly classified as positive.

20
New cards

The F1-score is most useful when the analyst wants to balance:

Precision and recall.

21
New cards

For highly imbalanced data, why can accuracy be misleading?

A model can achieve high accuracy by predicting the majority class most of the time.

22
New cards

Balanced accuracy is defined as:

(Sensitivity + Specificity)/2

23
New cards

Suppose TP = 30 and FN = 10. What is sensitivity?

0.75

24
New cards

Suppose TP = 30 and FP = 20. What is precision?

0.60

25
New cards

An ROC curve plots:

Sensitivity against false positive rate across thresholds

26
New cards

The false positive rate is equal to:

1 - Specificity

27
New cards

A point near the upper-left corner of the ROC plot generally indicates:

High sensitivity and low false positive rate

28
New cards

Why is an ROC curve considered threshold-independent?

It summarizes performance over many possible thresholds.

29
New cards

Which classifier would have an ROC curve close to the diagonal line from (0,0) to (1,1)?

A classifier with random ranking ability.

30
New cards

In ROC analysis, moving the threshold from high to low usually causes:

Both TPR and FPR to increase.

31
New cards

A lift chart is primarily used to evaluate:

How well a model ranks observations by likelihood of the positive class.

32
New cards
33
New cards

If the top 10% of ranked customers contains 30% of all responders, the cumulative lift at 10% is:

3.0

34
New cards

A cumulative lift chart compares the model with:

A random selection baseline.

35
New cards

A model with strong ranking performance should have a cumulative lift curve that:

Rises above the random baseline, especially in early deciles

36
New cards

Which statement about lift is correct?

Lift is most useful when ranking and targeting cases are important

37
New cards

AUC is best interpreted as:

The probability that a randomly chosen positive case receives a higher score than a randomly chosen negative case.

38
New cards

An AUC of 0.5 usually indicates:

Random ranking performance.

39
New cards

An AUC close to 1 indicates:

Strong ability to rank positive cases above negative cases.

40
New cards

The Gini coefficient used in binary classification is commonly computed as:

2 x AUC - 1

41
New cards

If AUC = 0.80, what is the Gini coefficient?

0.60

42
New cards

AUC is threshold-independent because:

It summarizes ranking performance across thresholds.

43
New cards

Log loss evaluates:

The quality of predicted probabilities for the actual class.

44
New cards

For binary classification, log loss is smallest when:

The model assigns high probability to the true class for each observation.

45
New cards

What happens when a model predicts probability near 0 for an observation whose true class is 1?

The log loss contribution is very large.

46
New cards

Which statement best compares log loss and accuracy?

Log loss uses probabilities, while accuracy uses predicted class labels after selecting a threshold.

47
New cards

Suppose y = 1 and the model predicts p-hat = 0.80. What is the log loss contribution?

-log(0.80)

48
New cards

Why can log loss be sensitive to outlying or unusual observations?

Because a few extremely confident wrong predictions can create very large loss values.

49
New cards

The Brier Score for binary classification is:

The mean squared difference between actual outcomes and predicted probabilities.

50
New cards

A smaller Brier Score indicates:

Better probability predictions.

51
New cards

Suppose y = 1 and p-hat = 0.70. What is the squared error contribution to the Brier Score?

0.09

52
New cards

Which statement best compares Brier Score and log loss?

Brier Score uses squared probability errors, while log loss uses logarithmic penalties

53
New cards

A Brier Score of 0 means:

Predicted probabilities match the binary outcomes perfectly.

54
New cards

A multi-class classification problem has:

Three or more possible class labels.

55
New cards

Macro-averaged recall is computed by:

Calculating recall separately for each class and then taking the unweighted average

56
New cards

Micro-averaged performance metrics are computed by:

Pooling the counts across all classes before computing the metric.

57
New cards

Which averaging method is usually more sensitive to poor performance on small classes?

Macro averaging

58
New cards

In a multi-class confusion matrix, the diagonal entries represent:

Correct classifications for each class

59
New cards

Why may overall accuracy be insufficient for multi-class imbalanced data?

It may be dominated by performance on the largest classes.

60
New cards

A predictive model is called a binary classification model when the response variable has exactly ______ possible classes.

two

61
New cards

In a binary classification model, the class often coded as 1 is usually called the ______ class.

positive

62
New cards

A logistic regression model for binary classification commonly estimates the probability that Y = ______.

1

63
New cards

Before computing accuracy or sensitivity, estimated probabilities must usually be converted into predicted ______.

classes

64
New cards

The probability value used to convert estimated probabilities into class labels is called the probability ______ or cut-off probability.

threshold

65
New cards

For a binary target with classes “Default” and “No Default,” predicting whether a borrower will default is a ______ classification problem.

binary

66
New cards

A confusion matrix compares the actual class labels with the predicted ______ labels

class

67
New cards

A true positive occurs when the actual class is positive and the predicted class is ______.

positive

68
New cards

A false positive occurs when the actual class is negative but the predicted class is ______.

positive

69
New cards

A false negative occurs when the actual class is positive but the predicted class is ______.

negative

70
New cards

If TP = 40, TN = 50, FP = 10, and FN = 5, the total sample size is ______

105

71
New cards

If an observation has actual class 0 and predicted probability 0.70 with p_cut = 0.50, this observation is a ______ positive.

false

72
New cards

Accuracy is defined as (TP + TN) divided by ______.

TP + TN + FP + FN

73
New cards

Sensitivity is also called recall or the true ______ rate.

positive

74
New cards

Specificity is also called the true ______ rate.

negative

75
New cards

Precision is also called the positive predictive ______.

value

76
New cards

The false positive rate is equal to FP divided by ______.

FP + TN

77
New cards

The false negative rate is equal to FN divided by ______.

FN + TP

78
New cards

The F1-score is the harmonic mean of precision and ______.

recall

79
New cards

Balanced accuracy is the average of sensitivity and ______.

specificity

80
New cards

For TP = 30, FN = 10, TN = 50, and FP = 10, sensitivity is ______.

0.75

81
New cards

For TP = 30, FP = 10, TN = 50, and FN = 10, precision is ______.

0.75

82
New cards

When the cut-off probability changes, threshold-dependent metrics usually ______

change

83
New cards

In a highly imbalanced dataset, accuracy can be misleading because it may be dominated by the ______ class.

majority

84
New cards

The ROC curve plots the true positive rate against the false ______ rate.

positive

85
New cards

The true positive rate is the same as ______.

sensitivity

86
New cards

The false positive rate is equal to 1 minus ______.

specificity

87
New cards

Each point on an ROC curve corresponds to a different probability ______.

threshold

88
New cards

A classifier with no discrimination ability is expected to have an ROC curve close to the ______ line.

diagonal

89
New cards

A better ROC curve is generally closer to the upper ______ corner.

left

90
New cards

A lift chart evaluates how well a model concentrates positive cases among observations with high predicted ______.

probabilities

91
New cards

Lift is commonly defined as the positive response rate in a selected group divided by the overall positive response ______.

rate

92
New cards

If the overall positive rate is 10% and the top decile positive rate is 30%, the lift for the top decile is ______.

3

93
New cards

A cumulative lift chart evaluates performance after accumulating observations from the highest predicted probability group downward to lower ______ groups.

probability

94
New cards

In marketing, lift charts are useful because they identify groups most likely to ______.

respond

95
New cards

A lift value of 1 indicates performance equivalent to ______ selection.

random

96
New cards

AUC stands for Area Under the ______ curve.

ROC

97
New cards

AUC can be interpreted as the probability that a randomly chosen positive case receives a higher predicted score than a randomly chosen ______ case.

negative

98
New cards

An AUC value of 0.5 indicates approximately ______ discrimination ability.

no

99
New cards

An AUC value closer to 1 indicates ______ discrimination performance.

better

100
New cards

The Gini coefficient for binary classification is commonly calculated as 2 × AUC minus ______.

1