You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sample code below to illustrate the issue. Documentation says that ratio can be between 0 and 1. However, oversample() gives an error if the ratio specified is really close to 1, and also error for ratio = 1. How can a user work around this?
newDataset <- oversample(glass0, ratio = 0.9, method = "SMOTE") #No problem
newDataset <- oversample(glass0, ratio = 1, method = "SMOTE")
Error in sample.int(length(x), size, replace, prob) :
cannot take a sample larger than the population when 'replace = FALSE'
newDataset <- oversample(glass0, ratio = 1.0, method = "SMOTE")
Error in sample.int(length(x), size, replace, prob) :
cannot take a sample larger than the population when 'replace = FALSE'
newDataset <- oversample(glass0, ratio = 0.95, method = "SMOTE")
newDataset <- oversample(glass0, ratio = 0.99, method = "SMOTE")
Error in sample.int(length(x), size, replace, prob) :
cannot take a sample larger than the population when 'replace = FALSE'
newDataset <- oversample(glass0, ratio = 0.98, method = "SMOTE")
Error in sample.int(length(x), size, replace, prob) :
cannot take a sample larger than the population when 'replace = FALSE'
newDataset <- oversample(glass0, ratio = 0.97, method = "SMOTE") #No error for ratio = 0.97
The text was updated successfully, but these errors were encountered:
I also found that this issue is dataset specific. With another dataset, I found that ratio = > 0.95 gives the same kind of error.
Sample code and resulting error:
dat3_L_M_SMOTE = oversample(dat3_L_M_numeric2, ratio=0.95, method= "SMOTE", classAttr = "sub_0_80")
Error in sample.int(length(x), size, replace, prob) :
cannot take a sample larger than the population when 'replace = FALSE'
Sample code below to illustrate the issue. Documentation says that ratio can be between 0 and 1. However, oversample() gives an error if the ratio specified is really close to 1, and also error for ratio = 1. How can a user work around this?
The text was updated successfully, but these errors were encountered: