I have fit a neural net in R:
model = nnet(f1/max(f1)~n1+n2+n3+n4+n5+n6+n7+n8+n9+n10+n11+n12,data=md,size=3)
From the model object I can extract the formula of the call, model$call$formula
, which returns an object of type call
and appears to be a list of length 3. I know I can use as.formula()
on the call
object in the nnet()
call but I don't know how to edit it first.
What I want to do is modify the formula and then pass it back to nnet()
. Specifically, I'd like to be able to change the dependent variable and add or remove dependent variables.