代码之家  ›  专栏  ›  技术社区  ›  Rafael Díaz

在rmarkdown中绘制神经网络

  •  1
  • Rafael Díaz  · 技术社区  · 6 年前

    ---
    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)
    ```
    

    你知道怎么解决吗。

    1 回复  |  直到 6 年前
        1
  •  3
  •   d125q    6 年前

    添加 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")
    ```