【问题标题】:plot neural net in rmarkdown在 rmarkdown 中绘制神经网络
【发布时间】:2018-09-24 19:17:29
【问题描述】:

我正在使用神经网络包来训练神经网络。我使用的是 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)
```

知道如何解决这个问题。

【问题讨论】:

标签: r rstudio r-markdown


【解决方案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")
```

【讨论】:

    猜你喜欢
    • 2017-02-03
    • 2017-08-27
    • 2022-01-20
    • 2017-11-10
    • 1970-01-01
    • 1970-01-01
    • 2012-09-08
    • 2017-02-19
    相关资源
    最近更新 更多