Here is a snipit of my code:
parameters$x<-0
parameters$y<-0
for (x in c(1:2)){
for (y in c(10,20,30,40,50,60,70,80,100)){
control <- rpart.control(minsplit = x,
minbucket = round(y),
maxdepth = 10,
cp = 0)
tune_fit <- rpart(survived~., data = data_train, method = 'class', control = control)
parameters[x] <-accuracy_tune(tune_fit)
}}
I basically want a table that has the x
rows and y
columns (based on what my x
and y
inputs are in the for loop) and then storing the output of the function as a value in this new table. I recognize what I am trying to do with parameters is not working.