I\'m trying to plot some neural network outputs, but I\'m not getting any result. Plotting normal stuff like plot(iris)
works fine, but there\'s something about
I think the issue is that for objects of class nn
, plot
uses a parameter rep
. If rep
is not defined, all repetitions are plotted in separate windows (when run outside of RMarkdown). If rep = "best"
, only the plot with the smallest error is generated. So this should work:
```{r}
library(neuralnet)
AND <- c(rep(0,3),1)
binary.data <- data.frame(expand.grid(c(0,1), c(0,1)), AND)
net <- neuralnet(AND~Var1+Var2, binary.data, hidden=0,err.fct="ce",
linear.output=FALSE)
plot(net, rep = "best")
```
See ?plot.nn
.