2
2
**Private method.**
3
3
4
4
Given the targets belonging to a specific category (level) for a categorical variable,
5
- find the frequency of the positive class (binary classification is assumed).
5
+ find the frequency of the reference class (binary classification is assumed).
6
6
7
7
# Arguments
8
8
@@ -11,10 +11,10 @@ find the frequency of the positive class (binary classification is assumed).
11
11
12
12
# Returns
13
13
14
- - `freq`: A float for the frequency of the positive class given the category
14
+ - `freq`: A float for the frequency of the reference class given the category
15
15
"""
16
16
function compute_label_freq_for_level (targets_for_level, y_classes)
17
- # Assumes binary classification where the first level is the positive class
17
+ # Assumes binary classification where the first level is the reference class
18
18
positive_class = y_classes[1 ]
19
19
freq = sum (targets_for_level .== positive_class) / length (targets_for_level)
20
20
return freq
@@ -52,7 +52,7 @@ find the frequency of each of the classes (multiclass classification assumed cla
52
52
53
53
# Returns
54
54
55
- - `freqs`: A vector of floats for the frequency of the positive class
55
+ - `freqs`: A vector of floats for the frequency of the reference class
56
56
"""
57
57
function compute_label_freqs_for_level (targets_for_level, y_classes)
58
58
# e.g., if y_classes = [1, 2, 3, 4]
@@ -100,7 +100,7 @@ Implement mixing between a posterior and a prior statistic by computing `λ * p
100
100
function mix_stats (; posterior, prior, λ)
101
101
# mixing prior and posterior with mixing factor λ
102
102
return λ .* posterior .+ (1 - λ) .* prior
103
- # prior is like the frequency of the positive class over the whole data
103
+ # prior is like the frequency of the reference class over the whole data
104
104
# posterior is the frequency given rows that have the specific catefory
105
105
end
106
106
0 commit comments