我正在使用Neuronet软件包来训练神经网络。我使用的是rmarkdown html格式,但是在打印时不显示绘图。
---
title: "neuralnet"
author: "RED"
date: "`r Sys.Date()`"
output:
html_document:
toc: yes
---
```{r}
library(neuralnet)
data(infert, package="datasets")
net.infert <- neuralnet(case~parity+induced+spontaneous, infert,
err.fct="ce", linear.output=FALSE, likelihood=TRUE)
```
```{r}
plot(net.infert)
```
任何想法如何解决此问题。
答案 0 :(得分:1)
将rep="best"
添加到plot
命令中。如果不这样做,plot.nn
会不断地opening new graphics devices来绘制每个训练纪元。
---
title: "neuralnet"
author: "RED"
date: "`r Sys.Date()`"
output:
html_document:
toc: yes
---
```{r}
library(neuralnet)
data(infert, package="datasets")
net.infert <- neuralnet(case~parity+induced+spontaneous, infert,
err.fct="ce", linear.output=FALSE, likelihood=TRUE)
```
```{r}
plot(net.infert, rep="best")
```