pub fn generate_rules(min_conf: &f32, counter: &FrequentItemsets, N: usize) -> Vec<Rule> {
    let N = N as f32;
    counter
        .iter()
        .filter_map(|(&itemset_size, itemset_counts)| {
            if itemset_size > 1 {
                Some(itemset_counts)
            } else {
                None
            }
        })
        .flat_map(|itemset_counts| {
            itemset_counts
                .iter()
                .flat_map(|(combi, _)| {
                    let combi: Itemset = combi.iter().copied().collect();
                    bfs(&combi, min_conf, counter, N)
                })
                .collect::<Vec<Rule>>()
        })
        .collect()
}
/// Generate rules based on frequent itemsets
Generate rules based on frequent itemsets
Generate rules based on frequent itemsets
pub fn generate_rules(min_conf: &f32, counter: &FrequentItemsets, N: usize) -> Vec<Rule> {
    let N = N as f32;
    counter
        .iter()
        .filter_map(|(&itemset_size, itemset_counts)| {
            if itemset_size > 1 {
                Some(itemset_counts)
            } else {
                None
            }
        })
        .flat_map(|itemset_counts| {
            itemset_counts
                .iter()
                .flat_map(|(combi, _)| {
                    let combi: Itemset = combi.iter().copied().collect();
                    bfs(&combi, min_conf, counter, N)
                })
                .collect::<Vec<Rule>>()
        })
        .collect()
}
pub fn generate_rules ( min_conf : & f32 , counter : & FrequentItemsets , N : usize ) -> Vec < Rule > { let N = N as f32 ; counter . iter ( ) . filter_map ( | ( & itemset_size , itemset_counts ) | { if itemset_size > 1 { Some ( itemset_counts ) } else { None } } ) . flat_map ( | itemset_counts | { itemset_counts . iter ( ) . flat_map ( | ( combi , _ ) | { let combi : Itemset = combi . iter ( ) . copied ( ) . collect ( ) ; bfs ( & combi , min_conf , counter , N ) } ) . collect :: < Vec < Rule > > ( ) } ) . collect ( ) }
Generate rules based on frequent itemsets
Generate rules based on frequent itemsets
min_conf
&f32
counter
&FrequentItemsets
N
usize
min_conf
&f32
counter
&FrequentItemsets
N
usize