Skip to main content

pyECLAT

Unlike the a priori method, the ECLAT method is not based on the calculation of confidence and lift, therefore the ECLAT method is based on the calculation of the support conjunctions of the variables.

pyECLAT is a simple package for associating variables based on the support of the different items of a dataframe.This method returns two dictionaries, one with the frequency of occurrence of the items conjunctions and the other with the support of the items conjunctions.

Install

Via pip

pip3 install pyECLAT

Via github

git clone https://github.com/jeffrichardchemistry/pyECLAT
cd pyECLAT
python3 setup.py install

Dependencies

numpy>=1.17.4, pandas>=0.25.3, tqdm>=4.41.1

How to use

This package has two dataframes as example, its possible to use:

from pyECLAT import Example1, Example2
ex1 = Example1().get()
ex2 = Example2().get()

The working dataframe should look like the one below. In this case, each line represents a customer's purchase at a supermarket.

0 1 2 3
0 milk beer bread butter
1 coffe bread butter NaN
2 coffe bread butter NaN
3 milk coffe bread butter
4 beer NaN NaN NaN
5 butter NaN NaN NaN
6 bread NaN NaN NaN
7 bean NaN NaN NaN
8 rice bean NaN NaN
9 rice NaN NaN NaN

This package works directly with a pandas dataframe without column's name. Example: Making your dataframe

import pandas as pd
dataframe = pd.read_csv('dir/of/file.csv', header=None)  

Run ECLAT method:

from pyECLAT import ECLAT
eclat_instance = ECLAT(data=dataframe, verbose=True) #verbose=True to see the loading bar

After getting eclat_instance, a binary dataframe is automatically generated, among other resources that can be accessed:

eclat_instance.df_bin   #generate a binary dataframe, that can be used for other analyzes.
eclat_instance.uniq_    #a list with all the names of the different items

eclat_instance.support, eclat_instance.fit and eclat_instance.fit_all are the functions to perform the calculations. Example:

get_ECLAT_indexes, get_ECLAT_supports = eclat_instance.fit(min_support=0.08,
                                                           min_combination=1,
                                                           max_combination=3,
                                                           separator=' & ',
                                                           verbose=True)

It is possible to access the documentation, as well as the description, of each method using:

help(eclat_instance.fit)
help(eclat_instance.fit_all)
help(eclat_instance.support)

Metadata

Release files for pyECLAT 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyECLAT 1.0.1
File Size Uploaded
pyECLAT-1.0.1.linux-x86_64.tar.gz 7.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyECLAT 1.0.1
File Interpreter ABI Platform
pyECLAT-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 13.6 kB

Release files / pyECLAT-1.0.1.linux-x86_64.tar.gz

Download URL pyECLAT-1.0.1.linux-x86_64.tar.gz
Size 7.3 kB
Tags Source
SHA-256 checksum
How to use checksums
bb13d7aecc8aa3b4c0d0b046f7e248c111f5b0a1442865e96a020a04e0c817a6
BLAKE2b-256 checksum
How to use checksums
c104e73c7f42c460aafce0db8fb1a5ea0028b6afe72ecc669c1d2d003ba98ba5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.6.9

Release files / pyECLAT-1.0.1-py3-none-any.whl

Download URL pyECLAT-1.0.1-py3-none-any.whl
Size 6.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
68ec87cffa76dc235cc75d846f7eeb1704b71184e8bd76ac2b4bf195e0bbcb3b
BLAKE2b-256 checksum
How to use checksums
76c9b830e36dc995e1ea8cc03b40ccf05939fcb6bea1881126f1afe1f726cce1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.6.9

Release history Release notifications | RSS feed

1.0.2

2 release files

This release

1.0.1 This release

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page