I am using Apriori to generate rules for the mushroom dataset and I was trying to figure out if there was an easy way to calculate the total coverage of a certain set of rules. I do not want the individual coverage of each rule, since that is easily available, but the total coverage of the top rules I choose. The end state goal is to answer the question: How many more rules does it take to cover an additional ___% of the population.
Right now I am generating the rules, then filtering the dataset based on those rules(shown below), then counting the number of returns, dividing that by the total number of records. Very cumbersome and time consuming. Any help would be appreciated.
posion.filter <- mushrooms.df %>% filter(mushrooms.df$gill.color=='b' | mushrooms.df$ring.type=='l' | mushrooms.df$odor =='f'| (mushrooms.df$cap.color=='e' & mushrooms.df$bruises. =='f')) summary(posion.filter$class) ediable.filter <- mushrooms.df %>% filter( mushrooms.df$odor == 'n' | (mushrooms.df$bruises.=='t'& mushrooms.df$habitat == 'd') | (mushrooms.df$gill.size=='b'& mushrooms.df$spore.print.color == 'k') | (mushrooms.df$gill.size=='b'& mushrooms.df$spore.print.color == 'n') | (mushrooms.df$stalk.surface.below.ring=='s'& mushrooms.df$population == 'y')) summary(ediable.filter$class)