Skip to content

Commit

Permalink
fix: penalization shoudn't be 0
Browse files Browse the repository at this point in the history
  • Loading branch information
laresbernardo committed Dec 23, 2024
1 parent ebb795c commit fdb9729
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: lares
Type: Package
Title: Analytics & Machine Learning Sidekick
Version: 5.2.10.9003
Version: 5.2.10.9004
Authors@R: c(
person("Bernardo", "Lares", , "[email protected]", c("aut", "cre")))
Maintainer: Bernardo Lares <[email protected]>
Expand Down
4 changes: 2 additions & 2 deletions R/robyn.R
Original file line number Diff line number Diff line change
Expand Up @@ -461,8 +461,8 @@ certainty_score <- function(
mutate(Si = ifelse(spend_wt == FALSE, 1, .data$spend / sum(.data$spend))) %>%
ungroup() %>%
mutate(
pen = ifelse(.data$P < .data$Pmax & .data$P > .data$Pmin, 0, penalization),
Xi = .data$Si * ((.data$P - .data$Pi)^2 * pen)
pen = ifelse(.data$P < .data$Pmax & .data$P > .data$Pmin, 1, penalization),
Xi = .data$Si * ((.data$P - .data$Pi)^2 * .data$pen)
) %>%
group_by(.data$solID, .data$cluster) %>%
summarize(Mi = sum(.data$Xi, na.rm = TRUE), .groups = "drop") %>%
Expand Down

0 comments on commit fdb9729

Please sign in to comment.