【问题标题】:Display a Loading Sign while a model is being trained in Shiny App在 Shiny App 中训练模型时显示加载标志
【发布时间】:2017-10-06 01:28:41
【问题描述】:

我正在制作一个闪亮的应用程序,在该应用程序中,单击 actionButton,使用 caret 包训练模型。由于此训练需要时间 - 大约 4-5 分钟 - 我想在应用程序中显示加载标志或加载 GIF,在模型训练后显示结果。否则,用户将不知道发生了什么或模型何时被训练。

谢谢

【问题讨论】:

    标签: r shiny r-caret shinydashboard


    【解决方案1】:

    您可以在 ui.R 中使用加载微调器

    # loading the library
    library(shinycssloaders)
    withSpinner()
    
    # For example, if you have the plot for which you would like to show loading spinner before it's gets drawn while making some data manipulation 
    withSpinner(plotOutput("my_plot")) 
    

    你可以在https://cran.r-project.org/web/packages/shinycssloaders/README.html找到更多信息

    【讨论】:

    • 这是一个很棒的答案!没想到这么容易。谢谢兄弟@Santosh ...
    • 亲爱的@Santosh,您能否告诉我在使用 caret 包训练 ML 模型时是否可以嵌入进度条,而不是加载 GIF?
    • 请发一个新问题,我会回答的。
    【解决方案2】:

    您可以制作进度条。示例如下:

    https://shiny.rstudio.com/articles/progress.html

    【讨论】:

    • 亲爱的兄弟,我已经看到了这个以及 Shiny 的其他文章,但是 a)它们非常混乱 b)他们只给出了 DataTables 和其他一些对我没有多大帮助的例子用于使用模型训练功能 ...
    猜你喜欢
    • 2023-03-13
    • 2021-02-19
    • 1970-01-01
    • 2020-02-07
    • 2019-07-17
    • 1970-01-01
    • 2022-06-14
    • 1970-01-01
    • 2019-08-08
    相关资源
    最近更新 更多