Questions tagged [nnet]

Software for feed-forward neural networks with a single hidden layer, and for multinomial log-linear models.

167 questions
4
votes
2 answers

Running a list of functions with different params with a single command

I am looking to test outcome of different regression/classification algorithms (i.e. svm, nnet, rpart, randomForest, naiveBayes, etc.) on the same data, to see which works better. But I need to have my code as short and clean as possible. To test…
Ali
  • 9,440
  • 12
  • 62
  • 92
3
votes
1 answer

Redefining R's nnet::multinom predict.multinom predict method to support type="link"

I would like to have R's nnet::multinom function being supported by the new marginaleffects package, but marginaleffects::predictions() relies on the predict() methods supplied by the modeling packages to compute predicted values on both the…
Tom Wenseleers
  • 7,535
  • 7
  • 63
  • 103
3
votes
2 answers

Get stargazer to print number of observations in multinomial logistic regression

is there a way to print the number of observations for the multinomial logistic regression model in a stargazer table? This sample code illustrates the problem. Thank you. var1<-sample(c('A', 'B', 'C'), size=1000,…
spindoctor
  • 1,719
  • 1
  • 18
  • 42
3
votes
1 answer

Multinomial regression (different results -- same dataset, R vs SPSS). nnet package -- multinom function

Recently, I had to work with R and SPSS to analyze a dataset with Multinomial Regression framework. We surveyed some participants (10-12 years old) and we asked which "professional field" they like the most, then we asked how often they accessed the…
Luis
  • 1,388
  • 10
  • 30
3
votes
1 answer

Integer overflow from many-leveled factor with class.ind()?

I'm trying to convert a "big" factor into a set of indicator (i.e. dummy, binary, flag) variables in R as such: FLN <- data.frame(nnet::class.ind(FinelineNumber)) where FinelineNumber is a 5,000-level factor from Kaggle.com's current Walmart…
Hack-R
  • 22,422
  • 14
  • 75
  • 131
3
votes
1 answer

R -- Editing the 'nnet' Package

I am trying to edit the R 'nnet' package. I have done some poking around, but am unfamiliar enough with R itself so as to not be able to make any headway. I have tried trace("nnet", edit=TRUE), as outlined in a previous post here. This results in…
DMML
  • 1,422
  • 4
  • 22
  • 39
3
votes
1 answer

Caret Package with "nnet" see weight of hidden layer

I'm using Caret Package to train a model using the "nnet" method. It's working but i need to see weights used in the hidden layers. This is possible when we use the nnet function directly: model<-nnet(Data[5:8],…
Hass0186
  • 51
  • 1
  • 4
3
votes
2 answers

error when using of nnet

it is an old question about nnet. However, i did not see the answer to this problem. when we use nnet, sometimes, it will report error as the following: Error in y - tmp : non-numeric argument to binary operator example seedsANN = nnet(train,…
Shicheng Guo
  • 1,233
  • 16
  • 19
3
votes
1 answer

Multinom with Matrix of Counts as Response

According to the help of multinom, package nnet, "The response should be a factor or a matrix with K columns, which will be interpreted as counts for each of K classes." I tried to use this function in the second case, obtaining an error. Here is a…
Pippo
  • 1,543
  • 3
  • 21
  • 40
3
votes
1 answer

using softmax in nnet R for target column with more than 2 states

I am using the nnet package for classification of a target column with 3 states model <- nnet(targetcolumn ~ ., data=DATAFRAME) But I want it to use entropy instead of default softmax and when I set softmax=false , it fails with the error : model…
user2912902
  • 327
  • 1
  • 7
  • 17
3
votes
1 answer

Bad compatibility of MuMin with multinom (nnet) objects having 3 level response variables?

I face a problem when trying to use the function model.avg of the MuMin package on objects resulting from the function multinom (package nnet). Although the manual list as multinom compatible, the model.avg function doesn't return the model average…
Ludovic Duvaux
  • 307
  • 2
  • 10
3
votes
1 answer

Sequential Neural Network

I am trying to construct a neural network as a generative model, to predict the next vector following a sequence of vectors (each vector is a distribution of real numbers of length n). My thought was to take k previous sequences and concatenate them…
zanbri
  • 5,958
  • 2
  • 31
  • 41
2
votes
1 answer

neural network with R package nnet: rubbish prediction due to overfitting?

Trying to figure out if I have an R problem or a general neural net problem. Say I have this data: set.seed(123) n = 1e3 x = rnorm(n) y = 1 + 3*sin(x/2) + 15*cos(pi*x) + rnorm(n = length(x)) df = data.frame(y,x) df$train = sample(c(TRUE, FALSE),…
invictus
  • 1,821
  • 3
  • 25
  • 30
2
votes
1 answer

Does the function multinom() from R's nnet package fit a multinomial logistic regression, or a Poisson regression?

The documentation for the multinom() function from the nnet package in R says that it "[f]its multinomial log-linear models via neural networks" and that "[t]he response should be a factor or a matrix with K columns, which will be interpreted as…
AJV
  • 153
  • 8
2
votes
1 answer

What is the scale of parameter estimates produced by nnet::multinom?

I'm using the multinom function from the nnet package to do multinomial logistic regression in R. When I fit the model, I expected to get parameter estimates on the logit scale. However, transforming variables with the inverse logit doesn't give…
missng
  • 199
  • 13
1
2
3
11 12