Hello all, Ive been playing with nnet (package 'nnet') and Ive come across this problem. nnet doesnt seems to like to have more than 1000 weights. If I do:> data(iris) > names(iris)[5] <- "species" > net <- nnet(species ~ ., data=iris, size=124, maxit=10)# weights: 995 initial value 309.342009 iter 10 value 21.668435 final value 21.668435 stopped after 10 iterations> table(iris$species[], predict(net, iris[], type="class"))setosa versicolor virginica setosa 50 0 0 versicolor 0 46 4 virginica 0 0 50 It works just fine, but if I do:> net <- nnet(species ~ ., data=iris, size=125, maxit=10)Error in nnet.default(x, y, w, softmax = TRUE, ...) : Too many (1003) weights Ive only changed 'size' from 124 to 125 giving me more than 1000 weights. Any ideas? Im I doing something wrong?> version_ platform i386-pc-linux-gnu arch i386 os linux-gnu system i386, linux-gnu status major 2 minor 0.1 year 2004 month 11 day 15 language R -- Ulises Cervi?o --- I place economy among the first and most important virtues, and public debt as the greatest of dangers to be feared. To preserve our independence, we must not let our rulers load us with perpetual debt. If we run into such debts, we must be taxed in our meat and drink, in our necessities and in our comforts, in our labor and in our amusements. If we can prevent the government from wasting the labor of the people, under the pretense of caring for them, they will be happy. -- Thomas Jefferson
You are not reading the help. from the help file ## Default S3 method: nnet(x, y, weights, size, Wts, mask, linout = FALSE, entropy = FALSE, softmax = FALSE, censored = FALSE, skip = FALSE, rang = 0.7, decay = 0, maxit = 100, Hess = FALSE, trace = TRUE, MaxNWts = 1000, abstol = 1.0e-4, reltol = 1.0e-8, ...) Look at MaxNWts Cervi?o Beresi Ulises wrote:> Hello all, > > Ive been playing with nnet (package 'nnet') and Ive come across this > problem. nnet doesnt seems to like to have more than 1000 weights. If I > do: > > >>data(iris) >>names(iris)[5] <- "species" >>net <- nnet(species ~ ., data=iris, size=124, maxit=10) > > # weights: 995 > initial value 309.342009 > iter 10 value 21.668435 > final value 21.668435 > stopped after 10 iterations > >>table(iris$species[], predict(net, iris[], type="class")) > > > setosa versicolor virginica > setosa 50 0 0 > versicolor 0 46 4 > virginica 0 0 50 > > It works just fine, but if I do: > > >>net <- nnet(species ~ ., data=iris, size=125, maxit=10) > > Error in nnet.default(x, y, w, softmax = TRUE, ...) : > Too many (1003) weights > > Ive only changed 'size' from 124 to 125 giving me more than 1000 > weights. > > Any ideas? Im I doing something wrong? > > >>version > > _ > platform i386-pc-linux-gnu > arch i386 > os linux-gnu > system i386, linux-gnu > status > major 2 > minor 0.1 > year 2004 > month 11 > day 15 > language R >