Dropping test data with nnet AI

When calculating an AI with the nnet method, 25% is used to test the data, and 75% is used to train. When clicking on the calculated AI's stats, under "control" there is a stat p with a value of 0.75, however changing p in the AI's declaration according to p = 1 for example doesn't work, it causes a syntax error. I have also found nothing else in the declaration of an nnet ai that fits. How can this be done?

Almost no one is going to be able to help you without something more substantial or a reprex to be honest. See here: FAQ: How to do a minimal reproducible example ( reprex ) for beginners


Fruit<-c("Banana", "Apple", "Banana", "Orange", "Appel")
Origin<-c("New Guinea", "China","Germany", "USA", "Germany")
Quality<-c("Good", "Bad", "Good", "Very bad", "Decent")

Fruits<-data.frame(Fruit, Origin, Quality, Price)
n <- 50
Fruits.replicated<-do.call("rbind", replicate(n, Fruits, simplify = FALSE))

KI <- train(
  x = as.data.frame(subset(Fruits.replicated, select=-c(`Price`))),
  y = Fruits.replicated$`Price`,
  method = "nnet",
  preProc = c("center", "scale"),
  trControl = trainControl(
    search = "random",
    allowParallel = TRUE,
    savePredictions = "final"
  tuneLength = 5,
  maxit = 500,
  MaxNWts = 5000,
  linout = TRUE,
  trace = TRUE

Let's use the example above. From what I know, 75% of the data in used for training, and 25% for testing. The value 0.75 (75%) coincides with the variable p in the neural network "AI", which can be found when clicking on "KI" and then "control".
Now to my question: Is it correct, that only 75% is used for actual training? If so, how can I change the value? Is the variable "p" responsible?

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.