How would one feed say, 100 different cases into the neuralnet()
function found in the neuralnet
package without maunally inputting them.
If there is a dataframe with colnames(df) = "one","two","three"..."one hundred"
and I want to use each column as an input into a neural network, is there a way to apply the neuralnet
function as such:
nn <- neuralnet(one~two+three+four+five+six+seven+eight...+one hundred, data=df,
err.fct = 'sse', linear.output = F, likelihood=T)
without actually typing all one hundred colnames.
I have tried inputting:
nn <- neuralnet(one~as.factor(paste(names(df)[-1], collapse="+")) data=df,
err.fct = 'sse', linear.output = F, likelihood=T)
and recieved the error
Error in model.frame.default(formula.reverse, data) :
variable lengths differ (found for 'as.factor(paste(names(df)[-1], collapse="+"))')