So I'm trying to fit a deep learning model into my data, using tidymodels
. The general interface for this is mlp()
and I'm using fit_resamples()
in order to find the best model to external data. I keep getting this error:
ann_model <-
mlp(epochs = 50, hidden_units = 5, dropout = 0.1) %>%
set_engine("nnet", weights = 10000) %>%
set_mode("regression")
ann_wflw <-
workflow() %>%
add_recipe(dados_recipe) %>%
add_model(ann_model)
ann_fit <-
ann_wflw %>%
fit_resamples(resamples = dados_cv)
x Fold01, Repeat1: model: Error in nnet.default(x, y, w, ...): too many (1301) weights
x Fold02, Repeat1: model: Error in nnet.default(x, y, w, ...): too many (1296) weights....
How do I change the weights? Please I'm really in a rush here. BTW is there any other approach to not overfit my training data other than cross validation? Thanks in advance!
I guess you want to increase
MaxNWts
parameter instead ofweights
.I'm quoting the below from the answer at I get error "Error in nnet.default(x, y, w, ...) : too many (77031) weights" while training neural networks
According to nnet documentation,
weights
is theWhereas
MaxNWts
is