paobranco/UBL

SmoteRegress - Oversampling - Weights of targets might be wrong

Opened this issue · 1 comments

UBL/R/smoteRegress.R

Lines 228 to 232 in e796812

d1 <- d2 <- 0
for(x in (1:nC)[-c(nomatr, tgt)]) {
d1 <- abs(T[i,x] - new[(i-1)*nexs+n,x])/ranges[x]
d2 <- abs(T[kNNs[i,neig],x] - new[(i-1)*nexs+n,x])/ranges[x]
}

This part of the code does not seem to be correct, because d1 and d2 are overwritten in every iteration of the loop. Am I mistaken?

Ah I just reported this. I think you are correct. That pretty much makes the results completely untrustworthy until this is fixed.