add_negative_terms: Add negative terms to rules

View source: R/Rule_building.R

add_negative_termsR Documentation

Add negative terms to rules

Description

Increases rule specificity by adding negative terms iteratively, selecting only terms that remove non-relevant records without impacting the number of positive matches. Usually not used by itself, but inside generate_rule_selection_set().

Usage

add_negative_terms(rules, target_vec, target_data)

Arguments

rules

A vector of rules as produced by extract_rules().

target_vec

A vector of labels.

target_data

A DTM with a number of rows as the elements in rules.

Value

A data frame with a column with the negative terms for each rule, the number of positive and negative matches identified by the negative terms in the target_data and the ID of these records..

pos/neg' = glue('tot_pos/tot_neg'),


bakaburg1/BaySREn documentation built on March 30, 2022, 12:16 a.m.