Hi,
I'm trying to build a code to record results from ANN's training in a tibble, but the code needs to loop over 3 different levels (4 networks, with 5 repetitions and 20 lines of the tibble for record).
Each network repetition corresponds to one tibble line (4x5)
I've been trying this for hours and it still didn't work.
Can someone help me please!
Here is the code:
for(k in 1:K) { (20 tibble lines)
for(i in 1:N) {4 networks)
for(j in 1:J) { (5 networks repetitions)
ANN
train_i <- redes[[i]]
Network prediction
Test result
output_j = compute(train_i, test, rep = j)
output_j$net.result
Train Result
train_j = compute(train_i, train, rep = j)
train_j$net.result
Estatistics
Test
vr_j <- cor(x = test[,"biom_stem"], y = output_j$net.result)
vrmse_j <- Metrics::rmse(test$biom_stem, output_j$net.result)
vmae_j <- Metrics::mae(test$biom_stem, output_j$net.result)
Train
tr_j <- cor(x = train[,"biom_stem"], y = train_j$net.result)
trmse_j <- Metrics::rmse(train$biom_stem, train_j$net.result)
tmae_j <- Metrics::mae(train$biom_stem, train_j$net.result)
tibble
results_ws[k, "Net"] <- j
results_ws[k, "r_validaĆ§Ć£o"] <- vr_j
results_ws[k, "RMSE_validaĆ§Ć£o"] <- vrmse_j
results_ws[k, "EMA_validaĆ§Ć£o"] <- vmae_j
results_ws[k, "r_treino"] <- tr_j
results_ws[k, "RMSE_treino"] <- trmse_j
results_ws[k, "EMA_treino"] <- tmae_j
}
}
}