Spaces:
Runtime error
Runtime error
Update app.R
Browse files
app.R
CHANGED
|
@@ -44,8 +44,7 @@ ui <- fluidPage(
|
|
| 44 |
|
| 45 |
# Show a plot of the generated distribution
|
| 46 |
mainPanel(
|
| 47 |
-
textOutput("stuff")
|
| 48 |
-
textOutput ("rv")
|
| 49 |
|
| 50 |
)
|
| 51 |
)
|
|
@@ -84,36 +83,6 @@ server <- function(input, output) {
|
|
| 84 |
# vip(FBMod)
|
| 85 |
return(TimStuff)
|
| 86 |
})
|
| 87 |
-
output$rv <- renderText({
|
| 88 |
-
data <- as.data.frame(5)
|
| 89 |
-
setnames(data,"5","start_speed")
|
| 90 |
-
data$start_speed <- input$velo
|
| 91 |
-
data$IVB <- input$ivb
|
| 92 |
-
if(input$phand == "L"){
|
| 93 |
-
data$HB <- input$hb * -1
|
| 94 |
-
}
|
| 95 |
-
else{
|
| 96 |
-
data$HB <- input$hb
|
| 97 |
-
}
|
| 98 |
-
data$EAA <- input$ext / 6.3
|
| 99 |
-
if(input$phand == "L"){
|
| 100 |
-
data$x0 <- input$x0 * -1
|
| 101 |
-
}
|
| 102 |
-
else{
|
| 103 |
-
data$x0 <- input$x0
|
| 104 |
-
}
|
| 105 |
-
data$z0 <- input$z0
|
| 106 |
-
data$spin_rate <- input$spinrate
|
| 107 |
-
data$SADiff <- input$spinaxisdiff
|
| 108 |
-
|
| 109 |
-
data <- as.matrix(data)
|
| 110 |
-
FBMod <- xgb.load('FB.model')
|
| 111 |
-
prediction <-predict(FBMod,data)
|
| 112 |
-
TimStuff <- (50 - (prediction - -0.0004397118)/ 0.2180433 * 10)
|
| 113 |
-
# FBMod <- xgb.load("FB.model")
|
| 114 |
-
# vip(FBMod)
|
| 115 |
-
return(prediction)
|
| 116 |
-
})
|
| 117 |
}
|
| 118 |
|
| 119 |
# Run the application
|
|
|
|
| 44 |
|
| 45 |
# Show a plot of the generated distribution
|
| 46 |
mainPanel(
|
| 47 |
+
textOutput("stuff")
|
|
|
|
| 48 |
|
| 49 |
)
|
| 50 |
)
|
|
|
|
| 83 |
# vip(FBMod)
|
| 84 |
return(TimStuff)
|
| 85 |
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 86 |
}
|
| 87 |
|
| 88 |
# Run the application
|