我是R Shiny的新手,以下是我的R代码:
library(shiny)
runApp(
list(
ui = fluidPage(
titlePanel("Upload & Results")
sidebarLayout(
sidebarPanel(
fileInput('file1', 'Choose csv File',accept = c(".csv")
)),
mainPanel(
tableOutput('contents'))
)
),
server = function(input, output){
output$contents <- renderTable({
req(input$file1)
inFile <- input$file1
df_test=read.csv(inFile$datapath, 1)
df1_test= df_test
Probabilty_Score = predict(classifier, type = 'response',newdata =
df1_test)
Output = as.factor(ifelse(Probabilty_Score<0.55,0,1))
cm2 = table(df_test$Result, Output)
print(caret::confusionMatrix(cm2))
})
}
)
)
它给了我所需的结果。在这里我想修改我的代码:
我想创建一个Number bar(0 to 100)
,其中包含概率值。
当我确实更改probability
的值时,我的结果confusion Matrix
应该相应地更改。
任何人都可以帮助我。