-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathevalue_model_umbal.R
51 lines (38 loc) · 1.03 KB
/
evalue_model_umbal.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# Evalue function -----------------------------------------------------------------------------
evalue_model_umbal <- function(TP, TN, FP, FN){
# Precision = minimizing false positives is the focus
precision = TP / (TP + FP)
# Recall: minimizing false negatives
recall = TP / (TP + FN)
# F1: combine both precision and recall into a single measure that captures both properties
f1 = (2 * precision * recall) / (precision + recall)
return(
glue::glue("
Precisao: {precision}
Recall: {recall}
F1: {f1}
")
)
}
# Task 1 --------------------------------------------------------------------------------------
# modelo RFE down-sample
## Reference
## Prediction negative positive
## negative 224 10
## positive 161 25
evalue(
TP = 25,
TN = 224,
FP = 161,
FN = 10
)
# Reference
# Prediction negative positive
# negative 0 7
# positive 0 28
evalue(
TP = 28,
TN = 0,
FP = 0,
FN = 7
)