Metadata-Version: 2.1
Name: flexcluster
Version: 0.0.4
Summary: flexible clustering algorithm that allows user-define dissimilarity an centroid calculation
Home-page: https://github.com/hcmarchezi/flexcluster
Author: Humberto Cardoso Marchezi
Author-email: hcmarchezi@gmail.com
License: UNKNOWN
Project-URL: Bug Tracker, https://github.com/hcmarchezi/flexcluster/issues
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE

# flexcluster 

flexcluster is a python package that provides a flexible implementation for clustering algorithms based on K-means.

The package provides a generic clustering function that allows customization with callback parameters:
* **dissimilarity function** - *function(datapoint1, datapoint2) : int* - function that defines the distance between 2 data points.
* **centroid calculation function** - *function(datapoints : np.array) : datapoint* - function that calculates a centroid given an array of datapoints.

```
centroids, centroid_labels = clustering(
            data, <--------------------------------- array of elements
            k=3, <---------------------------------- number of clusters
            dissimilarity_fn=dissimilarity_fn, <---- dissimilarity function
            centroid_calc_fn=centroid_calc_fn, <---- centroid calculation function
            max_tries=5) <-------------------------- number of clustering tries (get best result)
            
centroids => calculated centroids per cluster
centroid_labels => map with a numeric key for each cluster and value is an array of item indexes
```

Kmeans and kmedoids are also provided in this package as shortcuts to specific cluster configuration.

```
centroids, centroid_labels = kmeans(data, k=3)
```
```
centroids, centroid_labels = kmedoids(data, k=3)
```




