Skip to content

Commit

Permalink
Default class for RWeka classifiers.
Browse files Browse the repository at this point in the history
  • Loading branch information
mhahsler committed Nov 21, 2021
1 parent 03a0881 commit 8f3977a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
* added transactions2DF to convert transactions to a data.frame.
* RCAR is now faster (does not run glmnet again for the chosen lambda) and returns the whole regularization path.
* prepareTransactions now automatically add a negative class item if needed.
* moved the experimental algorithms wCBA and bCBA to Work
* moved the experimental algorithms wCBA and bCBA to Work.
* R/Weka-based classifiers have now a default class.


# arulesCBA 1.2.0 (2020-04-19)
Expand Down
4 changes: 2 additions & 2 deletions R/RWeka_CBA.R
Original file line number Diff line number Diff line change
Expand Up @@ -143,15 +143,14 @@ NULL

rules <- new("rules", lhs = lhs, rhs = rhs)

# FIXME: C4.5 is missing a default rule.

quality(rules) <- interestMeasure(rules, measure = c("support", "confidence"),
transactions = trans)

# assemble classifier
CBA_ruleset(
formula = formula,
rules = rules,
default = uncoveredMajorityClass(formula, trans, rules),
method = "first",
discretization = attr(trans, "disc_info"),
description = paste("RWeka classifier", attr(what, "meta")$name)
Expand Down Expand Up @@ -220,6 +219,7 @@ PART_CBA <- function(formula, data, control = NULL, disc.method = "mdlp")
CBA_ruleset(
formula = formula,
rules = rules,
default = uncoveredMajorityClass(formula, trans, rules),
method = "first",
discretization = attr(trans, "disc_info"),
description = paste("RWeka classifier", attr(what, "meta")$name)
Expand Down

0 comments on commit 8f3977a

Please sign in to comment.