Skip to content

Commit

Permalink
prdict.gam returned a 1D array instead of a vector
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcaseb committed Mar 1, 2021
1 parent e648e88 commit 7ace649
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/aggregate_game_stats.R
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ add_dakota <- function(add_to_this, pbp, weekly) {
dplyr::rename(player_id = .data$id) %>%
dplyr::filter(.data$player_id %in% relevant_players)

model_data$dakota <- mgcv::predict.gam(dakota_model, model_data)
model_data$dakota <- mgcv::predict.gam(dakota_model, model_data) %>% as.vector()

out <- add_to_this %>%
dplyr::left_join(
Expand All @@ -547,7 +547,7 @@ add_dakota <- function(add_to_this, pbp, weekly) {
dplyr::rename(player_id = .data$id) %>%
dplyr::filter(.data$player_id %in% relevant_players)

model_data$dakota <- mgcv::predict.gam(dakota_model, model_data)
model_data$dakota <- mgcv::predict.gam(dakota_model, model_data) %>% as.vector()

out <- add_to_this %>%
dplyr::left_join(
Expand Down

0 comments on commit 7ace649

Please sign in to comment.