Skip to content

"Frequent Mining Algorithms" is a Python library that includes frequent mining algorithms. This library contains popular algorithms used to discover frequent items and patterns in datasets. Frequent mining is widely used in various applications to uncover significant insights, such as market basket analysis, network traffic analysis, etc.

License

Notifications You must be signed in to change notification settings

fatihsen20/Frequent-Mining-Algorithms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FIMProject - Frequent Itemset Algorithms and Frequent Sequence Mining Algorithms in Python

PyPI Downloads Downloads Downloads

Installation

FIMProject requires Python 3.7 or newer, and the easiest way to install it is via pip:

pip install fimproject

Features

FIM

  • Apriori Algorithm
  • Eclat Algorithm
  • H-Mine Algorithm
  • Fp-Growth Algorithm
  • Association Rules(confidince, lift, kulc)

Todo

FSM

  • Add GSP Algorithm
  • Add Spade Algorithm
  • Add PrefixSpan Algorithm
  • Add SP-Tree Algorithm

Simple Example

from FIM import apriori
from FIM import association_rules
from FIM.utils import TransactionEncoder


# The apriori function expects data in a one-hot encoded pandas DataFrame.
# Suppose we have the following transaction data:
data = [['onion', 'beer', 'crisps', 'beef'],
        ['beer', 'tomato', 'crisps', 'eggs'],
        ['onion', 'crisps', 'eggs'],
        ['beer', 'eggs', 'beef'],
        ['onion', 'beer', 'carrot', 'crisps'],
        ['onion', 'eggs', 'beef'],
        ['onion', 'beer', 'carrot', 'crisps', 'eggs', 'beef'],
        ['onion', 'beer', 'crisps', 'eggs'],
        ['beer', 'tomato', 'carrot', 'eggs'],
        ['onion', 'crisps', 'eggs', 'beef'],
        ['beer', 'carrot', 'crisps', 'eggs']]

# We can transform it into the right format via the TransactionEncoder as follows:
te = TransactionEncoder()
df = te.fit_transform(data, set_pandas=True)

# Now, let us return the items and itemsets with at least 30% support:
freq_items = apriori(df, min_support=0.3)
# Now, let us return the association rules with freq_items df:
rules = association_rules(freq_items, metric="confidince", min_threshold=0.7)

What is df?

df is a pandas dataframe. It is a table of transactions. Each row is a transaction and each column is an item. The value of each cell is the number of items in the transaction.

Contributions

We would be delighted to receive contributions to this library. We openly welcome all kinds of feedback and are pleased to have contributions to address possible issues or add new features to the development process. Please contribute or raise issues through the GitHub repository.

About

"Frequent Mining Algorithms" is a Python library that includes frequent mining algorithms. This library contains popular algorithms used to discover frequent items and patterns in datasets. Frequent mining is widely used in various applications to uncover significant insights, such as market basket analysis, network traffic analysis, etc.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published