Skip to main content

Graphical Hypergeometric Networks

Project description

Python PyPI Version License Github Forks GitHub Open Issues Project Status Downloads Downloads Sphinx arXiv Medium Open In Colab DOI

HNET - Association ruled based networks using graphical Hypergeometric Networks.

Star this repo if you like it! ⭐️

Blog

Read more details and usage about HNet in this blog!

Dashboard HNet!

HNet Dashboard

Summary

HNet stands for graphical Hypergeometric Networks, which is a method where associations across variables are tested for significance by statistical inference. The aim is to determine a network with significant associations that can shed light on the complex relationships across variables. Input datasets can range from generic dataframes to nested data structures with lists, missing values and enumerations.

Real-world data often contain measurements with both continuous and discrete values. Despite the availability of many libraries, data sets with mixed data types require intensive pre-processing steps, and it remains a challenge to describe the relationships between variables. The data understanding phase is crucial to the data-mining process, however, without making any assumptions on the data, the search space is super-exponential in the number of variables. A thorough data understanding phase is therefore not common practice.

Methods

We propose graphical hypergeometric networks (HNet), a method to test associations across variables for significance using statistical inference. The aim is to determine a network using only the significant associations in order to shed light on the complex relationships across variables. HNet processes raw unstructured data sets and outputs a network that consists of (partially) directed or undirected edges between the nodes (i.e., variables). To evaluate the accuracy of HNet, we used well known data sets and generated data sets with known ground truth. In addition, the performance of HNet is compared to Bayesian association learning.

Results

We demonstrate that HNet showed high accuracy and performance in the detection of node links. In the case of the Alarm data set we can demonstrate on average an MCC score of 0.33 + 0.0002 (P<1x10-6), whereas Bayesian association learning resulted in an average MCC score of 0.52 + 0.006 (P<1x10-11), and randomly assigning edges resulted in a MCC score of 0.004 + 0.0003 (P=0.49).

Conclusions

HNet overcomes processes raw unstructured data sets, it allows analysis of mixed data types, it easily scales up in number of variables, and allows detailed examination of the detected associations.

Documentation

Method overview

Installation

  • Install hnet from PyPI (recommended).
pip install -U hnet

Examples

  • Simple example for the Titanic data set
# Initialize hnet with default settings
from hnet import hnet
# Load example dataset
df = hnet.import_example('titanic')
# Print to screen
print(df)
#      PassengerId  Survived  Pclass  ...     Fare Cabin  Embarked
# 0              1         0       3  ...   7.2500   NaN         S
# 1              2         1       1  ...  71.2833   C85         C
# 2              3         1       3  ...   7.9250   NaN         S
# 3              4         1       1  ...  53.1000  C123         S
# 4              5         0       3  ...   8.0500   NaN         S
# ..           ...       ...     ...  ...      ...   ...       ...
# 886          887         0       2  ...  13.0000   NaN         S
# 887          888         1       1  ...  30.0000   B42         S
# 888          889         0       3  ...  23.4500   NaN         S
# 889          890         1       1  ...  30.0000  C148         C
# 890          891         0       3  ...   7.7500   NaN         Q

Play with the interactive Titanic results.

Example: Learn association learning on the titanic dataset

Example: Summarize results

Networks can become giant hairballs and heatmaps unreadable. You may want to see the general associations between the categories, instead of the label-associations. With the summarize functionality, the results will be summarized towards categories.

Example: Feature importance

Performance


Contribute

  • All kinds of contributions are welcome!

Citation

Please cite HNet in your publications if this is useful for your research. See column right for citation information.

Maintainer

  • Erdogan Taskesen, github: erdogant
  • Contributions are welcome.
  • If you wish to buy me a Coffee for this work, it is very appreciated :)

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

hnet-1.2.0.tar.gz (49.2 kB view details)

Uploaded Source

Built Distribution

hnet-1.2.0-py3-none-any.whl (49.6 kB view details)

Uploaded Python 3

File details

Details for the file hnet-1.2.0.tar.gz.

File metadata

  • Download URL: hnet-1.2.0.tar.gz
  • Upload date:
  • Size: 49.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.10

File hashes

Hashes for hnet-1.2.0.tar.gz
Algorithm Hash digest
SHA256 cf3d2eda9f942dd183d548a7a29d42b39ab893bef4c87b340b935d51b14b728d
MD5 22d21976255130da11948da10952d519
BLAKE2b-256 bef8871015f9c5a24b17a0bb4757451e8970db238a9708615d8669c195097332

See more details on using hashes here.

Provenance

File details

Details for the file hnet-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: hnet-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 49.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.10

File hashes

Hashes for hnet-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8712bfbe055eb89a900ec0286706ba6ad86a62b33c6c0bc12b1f608e4e8ed349
MD5 4f1e80320c6927c5554d9b449b4bbc2f
BLAKE2b-256 e40a5173927ab4b7008e1efe2ade23d51c2f5d4ce8f5c0b85e4138a61ca719fb

See more details on using hashes here.

Provenance

Supported by

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