View source: R/Rule_building.R
simplify_ruleset | R Documentation |
Removes whole rules or components of the rules whose removal do not decrease the total number of positive matches found by applying the rules in the original data set.
simplify_ruleset(ruleset, target_vec, target_data)
ruleset |
A rule set as generated by |
target_vec |
A vector of labels. |
target_data |
A DTM with a number of rows as the elements in
|
The suggested approach is apply this function on the output of
generate_rule_selection_set()
after manual review of the proposed rules.
A data frame with the preserved rules, the redundant terms removed by
the rules, the number of positive and negative (absolute and cumulative)
records identified by the rules in the target_data
and the position
of these records in the target_data
.
## Not run: candidate_queries <- readRDS(file.path("Sessions", "Session1", "rule_data.rds")) Target <- candidate_queries$DTM$Target SpecificDTM <- candidate_queries$SpecificDTM simplified_rules <- file.path("Sessions", "Session1", "Selected_rules.xlsx") %>% import_data() %>% simplify_ruleset(target_vec = Target, target_data = SpecificDTM) %>% pull(rule) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.