Spaces:
Sleeping
Sleeping
Update app.R
Browse files
app.R
CHANGED
|
@@ -176,7 +176,7 @@ calculate_timstuff <- function(game) {
|
|
| 176 |
ishandL = ifelse(phand == "L",1,0))
|
| 177 |
# game <- calculate_primary(game)
|
| 178 |
|
| 179 |
-
feature_vars <- c("ishandL","start_speed", "IVB", "HB", "EAA", "x0", "z0", "spin_rate","SADiff","
|
| 180 |
complete_rows <- complete.cases(game[, feature_vars])
|
| 181 |
game_complete <- game[complete_rows, ]
|
| 182 |
game_na <- game[!complete_rows,]
|
|
@@ -188,7 +188,7 @@ calculate_timstuff <- function(game) {
|
|
| 188 |
#
|
| 189 |
# lhp$TimStuff <- scale_TimStuff(predict(model, as.matrix(cbind(lhp$ishandL,lhp$start_speed, lhp$IVB, lhp$HB, lhp$EAA, lhp$x0, lhp$z0, lhp$spin_rate, lhp$SADiff,lhp$primary_speed,lhp$primary_IVB,lhp$primary_HB))), -0.00249975, 0.007566558)
|
| 190 |
|
| 191 |
-
rhp$TimStuff <- scale_TimStuff(predict(model, as.matrix(cbind(rhp$ishandL,rhp$start_speed, rhp$IVB, rhp$HB, rhp$EAA, rhp$x0, rhp$z0, rhp$spin_rate, rhp$SADiff,rhp$
|
| 192 |
|
| 193 |
game_complete <- rbind(rhp,game_na)
|
| 194 |
return(game_complete)
|
|
|
|
| 176 |
ishandL = ifelse(phand == "L",1,0))
|
| 177 |
# game <- calculate_primary(game)
|
| 178 |
|
| 179 |
+
feature_vars <- c("ishandL","start_speed", "IVB", "HB", "EAA", "x0", "z0", "spin_rate","SADiff","primvelodiff","primivbdiff","primaryhbdiff")
|
| 180 |
complete_rows <- complete.cases(game[, feature_vars])
|
| 181 |
game_complete <- game[complete_rows, ]
|
| 182 |
game_na <- game[!complete_rows,]
|
|
|
|
| 188 |
#
|
| 189 |
# lhp$TimStuff <- scale_TimStuff(predict(model, as.matrix(cbind(lhp$ishandL,lhp$start_speed, lhp$IVB, lhp$HB, lhp$EAA, lhp$x0, lhp$z0, lhp$spin_rate, lhp$SADiff,lhp$primary_speed,lhp$primary_IVB,lhp$primary_HB))), -0.00249975, 0.007566558)
|
| 190 |
|
| 191 |
+
rhp$TimStuff <- scale_TimStuff(predict(model, as.matrix(cbind(rhp$ishandL,rhp$start_speed, rhp$IVB, rhp$HB, rhp$EAA, rhp$x0, rhp$z0, rhp$spin_rate, rhp$SADiff,rhp$primvelodiff,rhp$primivbdiff,rhp$primhbdiff))), -0.002491156, 0.0078211)
|
| 192 |
|
| 193 |
game_complete <- rbind(rhp,game_na)
|
| 194 |
return(game_complete)
|