Skip to main content
. 2020 May 12;3:33. doi: 10.3389/frai.2020.00033

Algorithm 2.

Targeting a balanced dataset

Input: Target rate PRt, biased acceptance rate PRbi
Output: Transition probabilities dȳ=js=i
1:     if PRt>PRbi then
2:         ℙ(ȳ = 1|y = 1, s = i)←1
3:     else
4:         (ȳ=1|y=1,s=i)PRtPRbi
5:     end if
6:     if j=0 then
7:         ℙ(ȳ = 0|y = 1, s = i)←1−ℙ(ȳ = 1|y = 1, s = i)
8:         dȳ=0s=i(ȳ=0|y=1,s=i)·PRbi1-PRt
9:     else if j=1 then
10:         dȳ=1s=i(ȳ=1|y=1,s=i)·PRbiPRt
11:     end if