1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
#------------------ # Data Preparation #------------------ #Read datasets #Descargar datos de http://datascience.esy.es/wp-content/uploads/2018/03/CreditData-1.zip train <- read.csv("Credit_train.csv") test <- read.csv("Credit_test.csv") #Rows and Cols dim(train) dim(test) #Columns name colnames(train) colnames(test) #Show head(train) head(test) #------- # ZeroR #------- #train train.frq <- table(train$DEFAULT) max.frq <- which.max(train.frq) model.zeror <- names(max.frq) #test test.count <- length(test$DEFAULT) test.error <- length(which(test$DEFAULT != model.zeror)) test.accuracy <- 1-(test.error/test.count) |
Ejemplo en R ZeroR
Mapa -> Predecir el Futuro (inferir) -> Modelizacion -> Clasificacion -> ZeroR -> Ejemplo R