Hi there!
I am having trouble using the garson() and olden() functions, the first one for example can be found here:
https://www.rdocumentation.org/packages/NeuralNetTools/versions/1.5.2/topics/garson
Since I need to program an AI first before using the functions on it, I need enough data rows, so that the function train() does not complain before we even get to the actual problem. Therefore I have quite a few data rows.
library(caret)
library(NeuralNetTools)
DoseTrack.prepared <- read.csv(
"C:/Changed.csv")
KI <- train(
x = as.data.frame(subset(DoseTrack.prepared, select=-c(`CTDIVol..mGy.`))),
y = DoseTrack.prepared$`CTDIVol..mGy.`,
method = "nnet",
preProc = c("center", "scale"),
trControl = trainControl(
search = "random",
allowParallel = TRUE,
savePredictions = "final"
),
tuneLength = 1,
maxit = 500,
MaxNWts = 5000,
linout = TRUE,
trace = TRUE
)
garson(KI)
olden(KI)
The file needed for the read.csv function can (hopefully) be found here:
https://github.com/DanielRSt/R-File
I am new to Github, however, so I hope the download of the file is publicly available. I have changed the data from the Original to censor, hence the name "Random" and the weird distribution of digits within the data frame, in case anyone is wondering. The type of data within each column remains the same, however. Make sure to change the code line
"C:/Changed.csv"
according to your save location.
The error, translated from german, is
"Error in strsplit(as.character(mod_in$terms[[2]]), " + ", fixed = TRUE)[[1]] :
Indexing out of bounds."
Any ideas on fixes?