GSP Python implementation
Project description
GSP-python
A Python implementation of Generalized Sequential Patterns (GSP) algorithm for sequential pattern mining
This project implements the Generalized Sequential Patterns (GSP) algorithm to find frequent sequences within a given dataset. This implementation includes parameters for the mingap, maxgap, and maxspan time constraints.
The project also features a simple dataset generator.
Installation
python3 -m pip install gsp_python
Usage
To run the gsp algorithm:
python3 -m gsp_python GSP infile outfile minsup -t maxgap mingap maxspan
To generate a random dataset:
python3 -m gsp_python DatasetGen outfile size nevents maxevents avgelems
For more information about arguments and additional optional arguments, type:
python3 -m gsp_python GSP -h
or
python3 -m gsp_python DatasetGen -h
Alternatively, the modules can be manually imported and used in a script. An example is given below:
from gsp_python.gsp import load_ds
from gsp_python.gsp import GSP
dataset, {}, {} = load_ds("path/to/file.txt")
algo_gsp = GSP(dataset, minsup=0.3, mingap=1, maxgap=2, maxspan=5)
output = algo_gsp.run_gsp()
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
gsp_python-0.0.9.tar.gz
(9.8 kB
view hashes)
Built Distribution
gsp_python-0.0.9-py3-none-any.whl
(10.2 kB
view hashes)
Close
Hashes for gsp_python-0.0.9-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ea6597cc4db10a178dca5a324df1a7ea366f1ad051bfb6f4329cb85d3dd95134 |
|
MD5 | 9d260a15e70e2938e1c66c7bd1d5cb7a |
|
BLAKE2b-256 | 2c07280c80b9b97dc05b8c091a1f445a4597493ebf54d796988b7c22e8b4fbba |