I am experimenting with the different algorithms in the neuralnet
package but when I try the traditional backprop
algorithm the results are very strange/disappointing. Almost all the calculated results are ~.33??? I assume I must be using the algorithm incorrectly as if I run it with the default rprop+
it does differentiate between samples. Surely normal backpropagation is not this bad especially if it is able to converge so quickly to the provided threshold.
library(neuralnet)
data(infert)
set.seed(123)
fit <- neuralnet::neuralnet(formula = case~age+parity+induced+spontaneous,
data = infert, hidden = 3,
learningrate = 0.01,
algorithm = "backprop",
err.fct = "ce",
linear.output = FALSE,
lifesign = 'full',
lifesign.step = 100)
preds <- neuralnet::compute(fit, infert[,c("age","parity","induced","spontaneous")])$net.result
summary(preds)
V1
Min. :0.3347060
1st Qu.:0.3347158
Median :0.3347161
Mean :0.3347158
3rd Qu.:0.3347162
Max. :0.3347286
Are some settings supposed to be different here?
Example default neuralnet
set.seed(123)
fit <- neuralnet::neuralnet(formula = case~age+parity+induced+spontaneous,
data = infert, hidden = 3,
err.fct = "ce",
linear.output = FALSE,
lifesign = 'full',
lifesign.step = 100)
preds <- neuralnet::compute(fit, infert[,c("age","parity","induced","spontaneous")])$net.result
summary(preds)
V1
Min. :0.1360947
1st Qu.:0.1516387
Median :0.1984035
Mean :0.3346734
3rd Qu.:0.4838288
Max. :1.0000000