Skip to content

Commit

Permalink
fix bug with observed_clean calculation.
Browse files Browse the repository at this point in the history
  • Loading branch information
mdancho84 committed Oct 31, 2023
1 parent d9a251c commit ce66f4d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/anomalize.R
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,8 @@ anomalize.data.frame <- function(
ret <- ret %>%
dplyr::mutate(
observed_clean = dplyr::case_when(
anomaly_direction == -1 ~ recomposed_l1 + (1-.clean_alpha)*anomaly_score,
anomaly_direction == 1 ~ recomposed_l2 - (1-.clean_alpha)*anomaly_score,
anomaly_direction == -1 ~ recomposed_l1 + (1-.clean_alpha)*(recomposed_l2-recomposed_l1)/2,
anomaly_direction == 1 ~ recomposed_l2 - (1-.clean_alpha)*(recomposed_l2-recomposed_l1)/2,
TRUE ~ observed
)
)
Expand Down

0 comments on commit ce66f4d

Please sign in to comment.