R/predict_function_test.R

# yeast_data <- read.table("./yeast.data")
# ###https://archive.ics.uci.edu/ml/datasets/Diabetic+Retinopathy+Debrecen+Data+Set
#
# x_data = yeast_data[,c(2:5,8:9)]
# y_label = yeast_data[,10]
# id0 = which(y_label=="CYT" | y_label=="MIT")
# y_data = rep(1,length(y_label))
# y_data[id0] = 0
# table(y_data)
# data = list(x_data=x_data, y_data=y_data)









# data(iris)
# data <- iris[, c(1, 2, 5)]
# data$Species <- factor(ifelse(data$Species == "setosa","rare","common"))
# ## checking the class distribution of this artificial data set
# table(data$Species)
# data_1 = rbind(data[1:15,],data[51:65,])












#
# library(DMwR)
#
# newData <- SMOTE(Species ~ ., data_1, perc.over = 600,perc.under=100)
# table(newData$Species)

# library(smotefamily)
# newData <- SMOTE(pilot_df[,-6], pilot_df[,6],K=5, dup_size = 2)
# new_data <- SMOTE(x_pilot, y_pilot, K = 5, dup_size = 10)
#
# data_example = sample_generator(5000,ratio = 0.80)
# genData = SMOTE(data_example[,-3],data_example[,3])
# genData_2 = SMOTE(data_example[,-3],data_example[,3],K=7)
ShudongSun/Sample-Size-Determination documentation built on Feb. 10, 2022, 1:33 a.m.