pub fn bfs(combi: &[ItemId], &min_conf: &f32, counter: &FrequentItemsets, N: f32) -> Vec<Rule> {
    let mut queue: VecDeque<Rule> = VecDeque::new();
    let mut blacklist = vec![];
    let mut final_rules = vec![];

    let rules = Rule::from_pattern(combi);
    queue.extend(rules);

    while let Some(mut rule) = queue.pop_front() {
        if rule.is_a_child_of_a_blacklisted_rule(&blacklist) {
            continue;
        }

        rule.compute_confidence(counter, combi, N);

        if rule.confidence >= min_conf {
            if let Some(new_rules) = rule.create_children(&blacklist, Some(&queue)) {
                queue.extend(new_rules);
            }
            final_rules.push(rule);
        } else {
            blacklist.push(rule);
        }
    }

    final_rules
}
/// Given a combination, find a list of rules that can be generated from it
Given a combination, find a list of rules that can be generated from it
Given a combination find a list of rules that can be generated from it
pub fn bfs(combi: &[ItemId], &min_conf: &f32, counter: &FrequentItemsets, N: f32) -> Vec<Rule> {
    let mut queue: VecDeque<Rule> = VecDeque::new();
    let mut blacklist = vec![];
    let mut final_rules = vec![];
    let rules = Rule::from_pattern(combi);
    queue.extend(rules);
    while let Some(mut rule) = queue.pop_front() {
        if rule.is_a_child_of_a_blacklisted_rule(&blacklist) {
            continue;
        }
        rule.compute_confidence(counter, combi, N);
        if rule.confidence >= min_conf {
            if let Some(new_rules) = rule.create_children(&blacklist, Some(&queue)) {
                queue.extend(new_rules);
            }
            final_rules.push(rule);
        } else {
            blacklist.push(rule);
        }
    }
    final_rules
}
pub fn bfs ( combi : & [ ItemId ] , & min_conf : & f32 , counter : & FrequentItemsets , N : f32 ) -> Vec < Rule > { let mut queue : VecDeque < Rule > = VecDeque :: new ( ) ; let mut blacklist = vec ! [ ] ; let mut final_rules = vec ! [ ] ; let rules = Rule :: from_pattern ( combi ) ; queue . extend ( rules ) ; while let Some ( mut rule ) = queue . pop_front ( ) { if rule . is_a_child_of_a_blacklisted_rule ( & blacklist ) { continue ; } rule . compute_confidence ( counter , combi , N ) ; if rule . confidence >= min_conf { if let Some ( new_rules ) = rule . create_children ( & blacklist , Some ( & queue ) ) { queue . extend ( new_rules ) ; } final_rules . push ( rule ) ; } else { blacklist . push ( rule ) ; } } final_rules }
Given a combination, find a list of rules that can be generated from it
Given a combination find a list of rules that can be generated from it
combi
&f32
counter
&FrequentItemsets
N
f32
combi
&f32
counter
&FrequentItemsets
N
f32