Skip to content

Commit

Permalink
stdLift: missing minimum support/conf info now causes a warning inste…
Browse files Browse the repository at this point in the history
…ad of an error.
  • Loading branch information
mhahsler committed May 15, 2020
1 parent 02814b7 commit dc5460e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions R/interestMeasures.R
Original file line number Diff line number Diff line change
Expand Up @@ -596,8 +596,10 @@ setMethod("interestMeasure", signature(x = "rules"),
c <- info(rules)$confidence
s <- info(rules)$support

if(is.null(c) || is.null(s)) stop("support or confidence info not available in rules. Use uncorrected std_lift instead.")
lambda <- pmax(lambda, 4*s/(1+s)^2, s/(supp_A * supp_B), c/supp_B)
if(!is.null(c) && !is.null(s))
lambda <- pmax(lambda, 4*s/(1+s)^2, s/(supp_A * supp_B), c/supp_B)
else
warning("minimum support or confidence not available in info(x). Using uncorrected std_lift instead.")
}

# lower bound of lift
Expand Down

0 comments on commit dc5460e

Please sign in to comment.