Sensitivity Analysis�
Dr. Debasis Samanta
Associate Professor
Department of Computer Science & Engineering
Topics in this session…
BDSET Course
2
DSamanta@IIT Kharagpur
Introduction
BDSET Course
3
DSamanta@IIT Kharagpur
BDSET Course
4
DSamanta@IIT Kharagpur
Estimation Strategy
Planning for Estimation
split
Data set Estimation
BDSET Course
5
DSamanta@IIT Kharagpur
Training data
Test data
Learning technique
CLASSIFIER
Estimation Strategies
BDSET Course
6
DSamanta@IIT Kharagpur
Holdout Method
BDSET Course
7
DSamanta@IIT Kharagpur
Random Subsampling
BDSET Course
8
DSamanta@IIT Kharagpur
Cross-Validation
BDSET Course
9
DSamanta@IIT Kharagpur
k-fold Cross-Validation
BDSET Course
10
DSamanta@IIT Kharagpur
Learning technique
CLASSIFIER
D1
Di
Dk
Data set
Fold 1
Fold i
Fold k
Accuracy
Performance
N-fold Cross-Validation
BDSET Course
11
DSamanta@IIT Kharagpur
N-fold Cross-Validation : Issue
BDSET Course
12
DSamanta@IIT Kharagpur
Bootstrap Method
BDSET Course
13
DSamanta@IIT Kharagpur
Bootstrap Method
BDSET Course
14
DSamanta@IIT Kharagpur
Bootstrap Method : Implication
BDSET Course
15
DSamanta@IIT Kharagpur
BDSET Course
16
DSamanta@IIT Kharagpur
Accuracy Estimation
Accuracy Estimation
BDSET Course
17
DSamanta@IIT Kharagpur
Accuracy : True and Predictive
BDSET Course
18
DSamanta@IIT Kharagpur
Predictive Accuracy
Example 11.1 : Universality of predictive accuracy
(MD)T1 = 95%
(MD)T2 = 70%
|T1| = 100 records
|T2| = 5000 records.
BDSET Course
19
DSamanta@IIT Kharagpur
Predictive Accuracy
BDSET Course
20
DSamanta@IIT Kharagpur
Error Estimation using Loss Functions
BDSET Course
21
DSamanta@IIT Kharagpur
N×(n+1)
Error Estimation using Loss Functions
BDSET Course
22
DSamanta@IIT Kharagpur
Statistical Estimation using Confidence Level
BDSET Course
23
DSamanta@IIT Kharagpur
N=10 | N=50 | N=100 | N=250 | N=500 | N=1000 | ||||||
H | T | H | T | H | T | H | T | H | T | H | T |
3 | 7 | 29 | 21 | 54 | 46 | 135 | 115 | 241 | 259 | 490 | 510 |
0.30 | 0.70 | 0.58 | 0.42 | 0.54 | 0.46 | 0.54 | 0.46 | 0.48 | 0.42 | 0.49 | 0.51 |
Statistical Estimation using Confidence Level
BDSET Course
24
DSamanta@IIT Kharagpur
Statistical Estimation using Confidence Level
BDSET Course
25
DSamanta@IIT Kharagpur
Statistical Estimation using Confidence Level
BDSET Course
26
DSamanta@IIT Kharagpur
| 0.5 | 0.7 | 0.8 | 0.9 | 0.95 | 0.98 | 0.99 |
| 0.67 | 1.04 | 1.28 | 1.65 | 1.96 | 2.33 | 2.58 |
Statistical Estimation using Confidence Level
BDSET Course
27
DSamanta@IIT Kharagpur
Statistical Estimation using Confidence Level
BDSET Course
28
DSamanta@IIT Kharagpur
BDSET Course
29
DSamanta@IIT Kharagpur
Performance Estimation
Performance Estimation of a Classifier
Example 11.3: Effectiveness of Predictive Accuracy
BDSET Course
30
DSamanta@IIT Kharagpur
Performance Estimation of a Classifier
BDSET Course
31
DSamanta@IIT Kharagpur
Confusion Matrix
BDSET Course
32
DSamanta@IIT Kharagpur
Confusion Matrix
Note:
= is the total number of positive instances.
= is the total number of negative instances.
= is the total number of instances.
BDSET Course
33
DSamanta@IIT Kharagpur
Confusion Matrix
Example 11.4: Confusion matrix
A classifier is built on a dataset regarding Good and Worst classes of stock markets. The model is then tested with a test set of 10000 unseen instances. The result is shown in the form of a confusion matrix. The result is self explanatory.
BDSET Course
34
DSamanta@IIT Kharagpur
Class | Good | Worst | Total | Rate(%) |
Good | 6954 | 46 | 7000 | 99.34 |
Worst | 412 | 2588 | 3000 | 86.27 |
Total | 7366 | 2634 | 10000 | 95.52 |
Predictive accuracy?
Confusion Matrix for Multiclass Classifier
BDSET Course
35
DSamanta@IIT Kharagpur
Confusion Matrix for Multiclass Classifier
Example 11.5: Confusion matrix with multiple class
Following table shows the confusion matrix of a classification problem with six classes labeled as C1, C2, C3, C4, C5 and C6.
BDSET Course
36
DSamanta@IIT Kharagpur
Class | C1 | C2 | C3 | C4 | C5 | C6 |
C1 | 52 | 10 | 7 | 0 | 0 | 1 |
C2 | 15 | 50 | 6 | 2 | 1 | 2 |
C3 | 5 | 6 | 6 | 0 | 0 | 0 |
C4 | 0 | 2 | 0 | 10 | 0 | 1 |
C5 | 0 | 1 | 0 | 0 | 7 | 1 |
C6 | 1 | 3 | 0 | 1 | 0 | 24 |
Predictive accuracy?
Confusion Matrix for Multiclass Classifier
Example 11.6: m×m CM to 2×2 CM
How we can calculate the predictive accuracy of the classifier model in this case?
Are the predictive accuracy same in both Example 11.5 and Example 11.6?
BDSET Course
37
DSamanta@IIT Kharagpur
Class | + | - |
+ | 52 | 18 |
- | 21 | 123 |
Performance Evaluation Metrics
BDSET Course
38
DSamanta@IIT Kharagpur
Performance Evaluation Metrics
BDSET Course
39
DSamanta@IIT Kharagpur
Performance Evaluation Metrics
BDSET Course
40
DSamanta@IIT Kharagpur
Precision and Recall
BDSET Course
41
DSamanta@IIT Kharagpur
Precision can be seen as a measure of quality.
Recall as a measure of quantity.
Higher precision means that an algorithm returns more relevant results than irrelevant ones.
Higher recall means that an algorithm returns most of the relevant results (whether or not irrelevant ones are also returned).
Performance Evaluation Metrics
BDSET Course
42
DSamanta@IIT Kharagpur
Performance Evaluation Metrics
BDSET Course
43
DSamanta@IIT Kharagpur
Metric | | | | |
Recall | 1 | 1 | 0 | 1 |
Precision | 1 | 0 | 1 | 0 |
| | | 1 | 0 |
Predictive Accuracy (ε)
BDSET Course
44
DSamanta@IIT Kharagpur
BDSET Course
45
DSamanta@IIT Kharagpur
Accuracy, Sensitivity and Specificity
BDSET Course
46
DSamanta@IIT Kharagpur
Sensitivity and Specificity
BDSET Course
47
DSamanta@IIT Kharagpur
Sensitivity refers to a test's ability to designate an individual with disease as positive.
A highly sensitive test means that there are few false negative results, and thus fewer cases of disease are missed.
Specificity refers to a test's ability to designate an individual who does not have a disease as negative.
A high specificity test means that there less miss classification.
Analysis with Performance Measurement Metrics
BDSET Course
48
DSamanta@IIT Kharagpur
|
| Predicted Class | |
|
| + | - |
Actual class | + | P | 0 |
- | 0 | N | |
Analysis with Performance Measurement Metrics
BDSET Course
49
DSamanta@IIT Kharagpur
|
| Predicted Class | |
|
| + | - |
Actual class | + | 0 | P |
- | N | 0 | |
Analysis with Performance Measurement Metrics
BDSET Course
50
DSamanta@IIT Kharagpur
|
| Predicted Class | |
|
| + | - |
Actual class | + | P | 0 |
- | N | 0 | |
Analysis with Performance Measurement Metrics
BDSET Course
51
DSamanta@IIT Kharagpur
|
| Predicted Class | |
|
| + | - |
Actual class | + | 0 | p |
- | 0 | N | |
Predictive Accuracy versus TPR and FPR
BDSET Course
52
DSamanta@IIT Kharagpur
BDSET Course
53
DSamanta@IIT Kharagpur
ROC Curves
ROC Curves
BDSET Course
54
DSamanta@IIT Kharagpur
ROC Plot
Identify the four extreme classifiers.
BDSET Course
55
DSamanta@IIT Kharagpur
Interpretation of Different Points in ROC Plot
BDSET Course
56
DSamanta@IIT Kharagpur
Interpretation of Different Points in ROC Plot
BDSET Course
57
DSamanta@IIT Kharagpur
Interpretation of Different Points in ROC Plot
BDSET Course
58
DSamanta@IIT Kharagpur
Interpretation of Different Points in ROC Plot
BDSET Course
59
DSamanta@IIT Kharagpur
Tuning a Classifier through ROC Plot
BDSET Course
60
DSamanta@IIT Kharagpur
Comparing Classifiers trough ROC Plot
BDSET Course
61
DSamanta@IIT Kharagpur
Comparing Classifiers trough ROC Plot
BDSET Course
62
DSamanta@IIT Kharagpur
A Quantitative Measure of a Classifier
BDSET Course
63
DSamanta@IIT Kharagpur
A Quantitative Measure of a Classifier
BDSET Course
64
DSamanta@IIT Kharagpur
Reference
BDSET Course
65
DSamanta@IIT Kharagpur
Data Mining: Concepts and Techniques, (3rd Edn.), Jiawei Han, Micheline Kamber, Morgan Kaufmann, 2015.
Introduction to Data Mining, Pang-Ning Tan, Michael Steinbach, and Vipin Kumar, Addison-Wesley, 2014
Any question?
BDSET Course
66
DSamanta@IIT Kharagpur