'Increasing Max Weights in neural netwrok

I have a very large data set with around 700000 lines and 26 predictor variables. My neural netwrok cannot run it all because the default max weights is set to 100. I am trying to use the MaxNWts to set it at 10000 but this gives me the following error. What can I do so it runs, even if it takes a bit longer.

  trainingData=sample(1:nrow(data),0.7*nrow(data))
predictors=c(1:21,23:27)
myNet=nnet.formula(data[,22]~ data$ï..PatientMRN+data$IsNewToProvider+data$IsOverbooked+data$IsOverride+data$AppointmentDateandTime+data$VisitType+data$DayofWeek+data$DepartmentSpecialty+data$LeadDays,data=data,  subset=trainingData, size=7, MaxNWts = 10000)

Forgot to include this is the error message i get

Error in nnet.default(x, y, w, ...) : 
      NA/NaN/Inf in foreign function call (arg 2)
    In addition: Warning message:
    In nnet.default(x, y, w, ...) : NAs introduced by coercion
r


Solution 1:[1]

Instead of trying to change the max weight, you should first normalize column-wise your data (before splitting into train-test!) so that the maximal value of each table is set to 1.0 since then all values of the table will be 0 <= value <= 1.0 your weights won't be huge.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Gwang-Jin Kim