Validation 

Now, let's count the frequency of the final tree that we have got and compare the frequency of each item with the table to ensure that we have got the correct frequencies in the table:

  • A:4
  • B:4
  • C:3
  • D:3

 

Now we will go from bottom to top. We will find out the branches where D appears:

We can see that there are three branches where D appears:

  • BC: 1
  • ABC: 1
  • A: 1

These branches are termed as conditional pattern base for D. While we do this, there are points to be kept in mind:

  • Even if we traverse from bottom to top, we write the branches in a top-to-bottom manner
  • D is not part of it
  • 1 represents the frequency of occurrence of D in each branch

Now, the conditional pattern for D results in the conditional frequencies for A, B, and C, which are 2, 2, and 2. All are less than the minimum support (3). Hence, there can't be any conditional FP- Tree for it.

Now, let's do it for C. C is appears in the following branches:

The branches end up like this:

  • B:1
  • AB:2

It results in A:2 and B:3. So, B fit with the bill in accordance with the minimum support. Now the conditional tree ends up like this:

Similarly, conditional pattern finding is done for different combinations. Thus, it sets up the frequent item dataset.

Let's see how it can be done in Python. We will be using a library called pyfpgrowth. Also, we shall create an itemset in the following section.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.133.128.145