Skip to content

Commit

Permalink
fix: relative non_zeroes calc p2
Browse files Browse the repository at this point in the history
  • Loading branch information
laresbernardo committed May 13, 2024
1 parent 3f1438b commit 7595a91
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/robyn.R
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ robyn_modelselector <- function(
summarise(
performance = sum(.data$xDecompAgg)/sum(.data$total_spend) - 1,
non_zeroes = length(.data$rn[
round(.data$coef, 6) == 0 & .data$rn %in% InputCollect$all_media]) /
round(.data$coef, 6) > 0 & .data$rn %in% InputCollect$all_media]) /
length(InputCollect$all_media),
top_channels = paste(.data$rn[head(rank(-.data$roi_total, ties.method = "first"), 3)], collapse = ", "),
zero_coef = paste(.data$rn[which(round(.data$coef, 6) == 0)], collapse = ", ")) %>%
Expand Down

0 comments on commit 7595a91

Please sign in to comment.