Skip to main content

ParTree - Data Partitioning through Tree-based Clustering Method

While existing clustering methods only provide the assignment of records to clusters without justifying the partitioning, we propose tree-based clustering methods that offer interpretable data partitioning through a shallow decision tree. These decision trees enable easy-to-understand explanations of cluster assignments through short and understandable split conditions. The proposed methods are evaluated through experiments on synthetic and real datasets and proved to be more effective than traditional clustering approaches and interpretable ones in terms of standard evaluation measures and runtime.

Setup

Using PyPI

pip install partree

Manual Setup

git clone https://github.com/cri98li/ParTree
cd ParTree
pip install -e .

Running the code

import pandas as pd
from ParTree import PrincipalParTree
from ParTree import print_rules

# load the data
df = pd.read_csv(dataset) 
X = df.values

#train the model
partree = PrincipalParTree()
partree.fit(X)

#extract the labels
labels = partree.labels_ 

#get the row explanation in a dictionary-like structure and print it
rules = partree.get_rules()
print(print_rules(rules, None, feature_names=df.columns))

You can find the software documentation in the /docs/ folder and a powerpoint presentation on Geolet can be found here. You can cite this work with

TODO

Additional Material

Clustering logic visualizations for diabetes dataset. From left to right: ParTree, k-Means, Hier:

Metadata

Release files for ParTree 0.0.4

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

Source distribution (sdist)

Source distribution for ParTree 0.0.4
File Size Uploaded Provenance Actions
ParTree-0.0.4.tar.gz 21.3 kB Without provenance Details for ParTree-0.0.4.tar.gz

Release files / ParTree-0.0.4.tar.gz

Download URL ParTree-0.0.4.tar.gz
Size 21.3 kB
Tags Source
SHA-256 checksum
How to use checksums
0afc555ec52fb8c3db1c990f10c3d63923b66ea79ac35411c768de5da671f4ad
BLAKE2b-256 checksum
How to use checksums
bdb40cef11c5a5d96cf3b562eb6906c5635b2c40b7855558bbd5298f238aa1b8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.6

Security for ParTree 0.0.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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