library(plyr)
library(dplyr)
library(ggplot2)
library(Amelia)
library(rpart)
library(imager)
Observations: 576
Variables: 6
$ X1 <int> 619, 664, 441, 160, 358, 335, 47, 164, 736, 436, 46...
$ MSLD <int> 2, 0, 1, 2, 1, 4, 2, 1, 5, 0, 2, 1, 2, 2, 2, 2, 2, ...
$ NOD <int> 50, 13, 16, 20, 24, 4, 7, 12, 46, 3, 10, 13, 6, 5, ...
$ TVDcc <int> 12500, 3250, 4000, 5000, 6000, 1000, 1750, 3000, 11...
$ MSFD <int> 98, 28, 35, 45, 77, 4, 14, 35, 98, 4, 28, 47, 15, 1...
$ MDIM2007 <int> 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, ...
[1] 8.67127
[1] 250
modelo1 <- rpart(MDIM2007 ~ MSLD + NOD + TVDcc + MSFD,
data = train, method = "class")
prediccion1<-predict(object=modelo1, newdata = test, type = "prob")
prediccion1<-data.frame(X1=test$X1,donate = prediccion1)
prediccion1<-select(prediccion1, -donate.0)
write.csv(prediccion1, file = "modelo1x.csv", row.names = FALSE)
modelo2 <- rpart(MDIM2007 ~ MSLD + NOD,
data = train, method = "class")
prediccion2<-predict(object=modelo2, newdata = test, type = "prob")
prediccion2<-data.frame(X1=test$X1,donate = prediccion2)
prediccion2<-select(prediccion2, -donate.0)
write.csv(prediccion2, file = "modelo2x.csv", row.names = FALSE)