cluster

Simple clustering library for python.

https://github.com/exhuma/python-cluster

Science Score: 10.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    1 of 5 committers (20.0%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (11.6%) to scientific vocabulary
Last synced: 11 months ago · JSON representation

Repository

Simple clustering library for python.

Basic Info
  • Host: GitHub
  • Owner: exhuma
  • License: lgpl-2.1
  • Language: Python
  • Default Branch: master
  • Size: 233 KB
Statistics
  • Stars: 65
  • Watchers: 10
  • Forks: 26
  • Open Issues: 3
  • Releases: 0
Created over 13 years ago · Last pushed over 5 years ago
Metadata Files
Readme Changelog License

README.rst

DESCRIPTION
===========

.. image:: https://readthedocs.org/projects/python-cluster/badge/?version=latest
    :target: http://python-cluster.readthedocs.org
    :alt: Documentation Status

python-cluster is a "simple" package that allows to create several groups
(clusters) of objects from a list. It's meant to be flexible and able to
cluster any object. To ensure this kind of flexibility, you need not only to
supply the list of objects, but also a function that calculates the similarity
between two of those objects. For simple datatypes, like integers, this can be
as simple as a subtraction, but more complex calculations are possible. Right
now, it is possible to generate the clusters using a hierarchical clustering
and the popular K-Means algorithm. For the hierarchical algorithm there are
different "linkage" (single, complete, average and uclus) methods available.

Algorithms are based on the document found at
http://www.elet.polimi.it/upload/matteucc/Clustering/tutorial_html/

.. note::
    The above site is no longer avaialble, but you can still view it in the
    internet archive at:
    https://web.archive.org/web/20070912040206/http://home.dei.polimi.it//matteucc/Clustering/tutorial_html/


USAGE
=====

A simple python program could look like this::

   >>> from cluster import HierarchicalClustering
   >>> data = [12,34,23,32,46,96,13]
   >>> cl = HierarchicalClustering(data, lambda x,y: abs(x-y))
   >>> cl.getlevel(10)     # get clusters of items closer than 10
   [96, 46, [12, 13, 23, 34, 32]]
   >>> cl.getlevel(5)      # get clusters of items closer than 5
   [96, 46, [12, 13], 23, [34, 32]]

Note, that when you retrieve a set of clusters, it immediately starts the
clustering process, which is quite complex. If you intend to create clusters
from a large dataset, consider doing that in a separate thread.

For K-Means clustering it would look like this::

    >>> from cluster import KMeansClustering
    >>> cl = KMeansClustering([(1,1), (2,1), (5,3), ...])
    >>> clusters = cl.getclusters(2)

The parameter passed to getclusters is the count of clusters generated.


.. image:: https://readthedocs.org/projects/python-cluster/badge/?version=latest
    :target: http://python-cluster.readthedocs.org
    :alt: Documentation Status

Owner

  • Name: Michel Albert
  • Login: exhuma
  • Kind: user
  • Location: Luxembourg

GitHub Events

Total
Last Year

Committers

Last synced: 12 months ago

All Time
  • Total Commits: 117
  • Total Committers: 5
  • Avg Commits per committer: 23.4
  • Development Distribution Score (DDS): 0.171
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Michel Albert m****l@a****u 97
Sam Sandberg s****g@g****m 13
Tim Littlefair t****r@g****m 4
santosh653 7****3 2
Marvin Kastner 1****r@i****e 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 12 months ago

All Time
  • Total issues: 25
  • Total pull requests: 9
  • Average time to close issues: about 2 months
  • Average time to close pull requests: 13 days
  • Total issue authors: 9
  • Total pull request authors: 5
  • Average comments per issue: 2.28
  • Average comments per pull request: 3.22
  • Merged pull requests: 7
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • exhuma (14)
  • 1kastner (3)
  • tim-littlefair (2)
  • Telofy (1)
  • garyvdm (1)
  • guihui (1)
  • dbinetti (1)
  • peterjc (1)
  • RogerTangos (1)
Pull Request Authors
  • loisaidasam (3)
  • tim-littlefair (3)
  • jjaranda13 (1)
  • 1kastner (1)
  • santosh653 (1)
Top Labels
Issue Labels
bug (9) enhancement (4) duplicate (2)
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 6,042 last-month
  • Total docker downloads: 243
  • Total dependent packages: 0
  • Total dependent repositories: 101
  • Total versions: 18
  • Total maintainers: 1
pypi.org: cluster
  • Versions: 18
  • Dependent Packages: 0
  • Dependent Repositories: 101
  • Downloads: 6,042 Last month
  • Docker Downloads: 243
Rankings
Dependent repos count: 1.5%
Downloads: 3.5%
Docker downloads count: 4.0%
Average: 5.8%
Forks count: 7.6%
Stargazers count: 8.3%
Dependent packages count: 10.1%
Maintainers (1)
Last synced: 12 months ago

Dependencies

dev-requirements.txt pypi
  • sphinx * development