Universal clustering based on dialectical materialism
Project description
DRUHG
Basic Concept
How to use DRUHG
import sklearn.datasets as datasets
import druhg
iris = datasets.load_iris()
XX = iris['data']
clusterer = druhg.DRUHG(max_ranking=50)
labels = clusterer.fit(XX).labels_
It will build the tree and label the points. Now you can manipulate clusters by relabeling.
labels = dr.relabel(limit1=0, limit2=len(XX)/2, fix_outliers=1)
ari = adjusted_rand_score(iris['target'], labels)
print ('iris ari', ari)
Performance
Installing
PyPI install, presuming you have an up to date pip:
pip install druhg
Running the Tests
The package tests can be run after installation using the command:
nosetests -s druhg
or, if nose is installed but nosetests is not in your PATH variable:
python -m nose -s druhg
The tests may fail :-D
Python Version
The druhg library supports both Python 2 and Python 3.
Contributing
We welcome contributions in any form! Assistance with documentation, particularly expanding tutorials, is always welcome. To contribute please fork the project make your changes and submit a pull request. We will do our best to work through any issues with you and get your code merged into the main branch.
Licensing
The druhg package is 3-clause BSD licensed.
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.