Skip to main content

Some Python optimization algorithms for mining gradual patterns.

Project description

SO4GP stands for: "Some Optimizations for Gradual Patterns". SO4GP applies optimizations such as swarm intelligence, HDF5 chunks, cluster analysis and many others in order to improve the efficiency of extracting gradual patterns. It provides Python algorithm implementations for these optimization techniques. The algorithm implementations include:

  • (Classical) GRAANK algorithm for extracting GPs
  • Ant Colony Optimization algorithm for extracting GPs
  • Genetic Algorithm for extracting GPs
  • Particle Swarm Optimization algorithm for extracting GPs
  • Random Search algorithm for extracting GPs
  • Local Search algorithm for extracting GPs
  • Clustering-based algorithm for extracting GPs

A GP (Gradual Pattern) is a set of gradual items (GI) and its quality is measured by its computed support value. For example given a data set with 3 columns (age, salary, cars) and 10 objects. A GP may take the form: {age+, salary-} with a support of 0.8. This implies that 8 out of 10 objects have the values of column age 'increasing' and column 'salary' decreasing.

Installation

pip install so4gp

Usage

In order to any algorithm for the purpose of extracting GPs, follow the instructions that follow.

First and foremost, import the so4gp python package via:

import so4gp as sgp

GRAdual rANKing Algorithm for GPs (GRAANK)

This is the classical approach (initially proposed by Anne Laurent) for mining gradual patterns. All the remaining algorithms are variants of this algorithm.

import so4gp as sgp

mine_obj = sgp.GRAANK(data_source=f_path, min_sup=0.5, eq=False)
gp_json = mine_obj.discover()
print(gp_json)

where you specify the parameters as follows:

  • data_source - [required] data source {either a file in csv format or a Pandas DataFrame}
  • min_sup - [optional] minimum support default = 0.5
  • eq - [optional] encode equal values as gradual default = False

Sample Output

The default output is the format of JSON:

{
	"Algorithm": "RS-GRAANK",
	"Best Patterns": [
            [["Age+", "Salary+"], 0.6], 
            [["Expenses-", "Age+", "Salary+"], 0.6]
	],
	"Iterations": 20
}

References

  • Owuor, D., Runkler T., Laurent A., Menya E., Orero J (2021), Ant Colony Optimization for Mining Gradual Patterns. International Journal of Machine Learning and Cybernetics. https://doi.org/10.1007/s13042-021-01390-w
  • Dickson Owuor, Anne Laurent, and Joseph Orero (2019). Mining Fuzzy-temporal Gradual Patterns. In the proceedings of the 2019 IEEE International Conference on Fuzzy Systems (FuzzIEEE). IEEE. https://doi.org/10.1109/FUZZ-IEEE.2019.8858883.
  • Laurent A., Lesot MJ., Rifqi M. (2009) GRAANK: Exploiting Rank Correlations for Extracting Gradual Itemsets. In: Andreasen T., Yager R.R., Bulskov H., Christiansen H., Larsen H.L. (eds) Flexible Query Answering Systems. FQAS 2009. Lecture Notes in Computer Science, vol 5822. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-04957-6_33

See Docs for more details

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

so4gp-0.6.9.tar.gz (76.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

so4gp-0.6.9-py3-none-any.whl (66.2 kB view details)

Uploaded Python 3

File details

Details for the file so4gp-0.6.9.tar.gz.

File metadata

  • Download URL: so4gp-0.6.9.tar.gz
  • Upload date:
  • Size: 76.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for so4gp-0.6.9.tar.gz
Algorithm Hash digest
SHA256 27b0f55a60811e01ab0f9b24a3711d1ade206414a7c4b9792b43822f32673173
MD5 3c4f37978e03029f676b5b05089ea9a7
BLAKE2b-256 5faa3c2e1ec60986bff2ea9facb300f905ab524b27a51f281805b59d1b031609

See more details on using hashes here.

File details

Details for the file so4gp-0.6.9-py3-none-any.whl.

File metadata

  • Download URL: so4gp-0.6.9-py3-none-any.whl
  • Upload date:
  • Size: 66.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for so4gp-0.6.9-py3-none-any.whl
Algorithm Hash digest
SHA256 991a17a61ef7e6e78a1a1896e61a5fa5bffd3a9a032ed124063543e8bb9322a3
MD5 ad31dc10db3eadfad812cfb87bb44148
BLAKE2b-256 23ad8fceb77e141b0d66f3861a0b664f9de0f20f1908df8d7f9fcee0b7722e8c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page