> # create formula (without comma index on column names) fm <-
> as.formula(paste("resp ~", paste(colnames(mydata)[1:3110],
> collapse="+")))
>
> # call neuralnet
> out <- neuralnet(fm,data=mydata, hidden = 4, lifesign = "minimal",
> linear.output = FALSE, threshold = 0.1)
Does neuralnet not re
Soheila,
Set the name of the last column and remove the comma indexing the column
names. It is a vector and therefore doesn't need a comma for indexing.
Also, after loading your dataset I realized you also have invalid column
names. The mixes between hyphens and underscores makes the as.formula
Dear Charles,
I rewrote code :
library("neuralnet")
resp<-c(1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,1,0,1,0,1))
mydata <- cbind(data24_2, resp)
dim(mydata)
> 20 3111
fm <- as.formula(paste("resp ~ ", paste(colnames(mydata)[,1:3110],
collapse="+")))
> Error in colnames(mydata)[, 1:3110] : incorrect number
3 matches
Mail list logo