author: Samuel Bozzi Baco date: June, 18, 2020 autosize: true
This is a presentation about the Shiny App "Iris Tree Plot"
"https://samuelbozzibaco.shinyapps.io/Iris_Tree_Plot/"
The only input the user needs to do is the number of splits the tree must be fited.
Then the app plots the tree and the ROC curve for the fit.
sidebarLayout(
sidebarPanel(
sliderInput("Splits",
"Number of splits:",
min = 1,
max = 4,
value = 3,
step = 1,
ticks = FALSE)
),
The UI consist on a slider (varying from 1 to 4) that get the number of splits for rpart to fit tree.
mainPanel(
tabsetPanel(type = "tabs",
tabPanel("Tree", plotOutput("rpartPlot")),
tabPanel("ROC Curve", plotOutput("roc"))
There are two results presented in a tabet format: the tree plot from rpart.plot package and a ROC curve from multiROC package.
The server function uses a reactive function to fit the model. Than the both rpart.plot and ROC curves gplot is constructed.
mdl <- reactive({
rpart(Species ~., data = iris, cp = -1, maxdepth = input$Splits)
})
The full code can be fount at github repository
"https://github.com/qymera0/irisrpart"
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.