pub struct FPResult<T> { /* private fields */ }
Implementations§
Source§impl<T: ItemType> FPResult<T>
impl<T: ItemType> FPResult<T>
pub fn new( frequent_patterns: Vec<(Vec<T>, usize)>, elimination_sets: HashSet<Vec<T>>, ) -> FPResult<T>
Sourcepub fn frequent_patterns_num(&self) -> usize
pub fn frequent_patterns_num(&self) -> usize
Examples found in repository?
examples/example_usage.rs (line 21)
3fn main() {
4 let transactions = vec![
5 vec!["e", "c", "a", "b", "f", "h"],
6 vec!["a", "c", "g"],
7 vec!["e"],
8 vec!["e", "c", "a", "g", "d"],
9 vec!["a", "c", "e", "g"],
10 vec!["e"],
11 vec!["a", "c", "e", "b", "f"],
12 vec!["a", "c", "d"],
13 vec!["g", "c", "e", "a"],
14 vec!["a", "c", "e", "g"],
15 vec!["i"],
16 ];
17 let minimum_support = 2;
18 let fp_growth_str = FPGrowth::<&str>::new(transactions, minimum_support);
19
20 let result = fp_growth_str.find_frequent_patterns();
21 println!("The number of results: {}", result.frequent_patterns_num());
22 for (frequent_pattern, support) in result.frequent_patterns().iter() {
23 println!("{:?} {}", frequent_pattern, support);
24 }
25}
Sourcepub fn frequent_patterns(&self) -> Vec<(Vec<T>, usize)>
pub fn frequent_patterns(&self) -> Vec<(Vec<T>, usize)>
Examples found in repository?
examples/example_usage.rs (line 22)
3fn main() {
4 let transactions = vec![
5 vec!["e", "c", "a", "b", "f", "h"],
6 vec!["a", "c", "g"],
7 vec!["e"],
8 vec!["e", "c", "a", "g", "d"],
9 vec!["a", "c", "e", "g"],
10 vec!["e"],
11 vec!["a", "c", "e", "b", "f"],
12 vec!["a", "c", "d"],
13 vec!["g", "c", "e", "a"],
14 vec!["a", "c", "e", "g"],
15 vec!["i"],
16 ];
17 let minimum_support = 2;
18 let fp_growth_str = FPGrowth::<&str>::new(transactions, minimum_support);
19
20 let result = fp_growth_str.find_frequent_patterns();
21 println!("The number of results: {}", result.frequent_patterns_num());
22 for (frequent_pattern, support) in result.frequent_patterns().iter() {
23 println!("{:?} {}", frequent_pattern, support);
24 }
25}
pub fn elimination_sets_num(&self) -> usize
pub fn elimination_sets(&self) -> Vec<Vec<T>>
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for FPResult<T>
impl<T> RefUnwindSafe for FPResult<T>where
T: RefUnwindSafe,
impl<T> Send for FPResult<T>where
T: Send,
impl<T> Sync for FPResult<T>where
T: Sync,
impl<T> Unpin for FPResult<T>where
T: Unpin,
impl<T> UnwindSafe for FPResult<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more