Book Image

Machine Learning Quick Reference

By : Rahul Kumar
Book Image

Machine Learning Quick Reference

By: Rahul Kumar

Overview of this book

Machine learning makes it possible to learn about the unknowns and gain hidden insights into your datasets by mastering many tools and techniques. This book guides you to do just that in a very compact manner. After giving a quick overview of what machine learning is all about, Machine Learning Quick Reference jumps right into its core algorithms and demonstrates how they can be applied to real-world scenarios. From model evaluation to optimizing their performance, this book will introduce you to the best practices in machine learning. Furthermore, you will also look at the more advanced aspects such as training neural networks and work with different kinds of data, such as text, time-series, and sequential data. Advanced methods and techniques such as causal inference, deep Gaussian processes, and more are also covered. By the end of this book, you will be able to train fast, accurate machine learning models at your fingertips, which you can easily use as a point of reference.
Table of Contents (18 chapters)
Title Page
Copyright and Credits
About Packt
Contributors
Preface
Index

Frequent pattern growth


Frequent pattern growth (FP-growth) is a frequent itemset generation technique (similar to Apriori). FP-Growth builds a compact-tree structure and uses the tree for frequent itemset mining and generating rules. It is faster than Apriori and can throw results with large datasets.

Let's go through the steps of FP-Growth:

  1. Setting up the transactions: This step sets up the items by frequency. However, the items are set up vertically, not horizontally. That means transforming input from transaction to items:

t_id

Items

1

(B, C, D, A)

2

(B, C, D)

3

(D, A)

4

(A, B)

5

(A, C, B)

  1. Finding the frequency: Now we have to find out the frequency of each item individually:

Items

Frequency

A

4

B

4

C

3

D

3

Let's set up the minimum threshold or minimum support as 50%:

    • Min Support = (5*50/100) = 2.5
    • Ceiling of minimum support = 2.5 ~ 3
  1. Prioritize the items by frequency: Since all the items have a frequency greater than or equal to minimum support, all the items will be part of it. Also, based on their frequency,...