Skip to main content

A python package for LSH-k-Centers algorithm

Project description

Python implementations of the LSH-k-Centers algorithms for clustering categorical data:

Installation:

Using pip:

pip install lshkcenters

Import the packages:

import numpy as np
from LSHkCenters.LSHkCenters import LSHkCenters

Generate a simple categorical dataset:

X = np.array([[0,0,0],[0,1,1],[0,0,0],[1,0,1],[2,2,2],[2,3,2],[2,3,2]])
y = np.array([0,0,0,0,1,1,1])

LSH-k-Centers:

kcens = LSHkCenters(X,y,n_init=5,k=2)
kcens.SetupLSH()
kcens.DoCluster()

Built-in evaluattion metrics:

kcens.CalcScore()

Out come:

Purity: 1.000 NMI: 1.00 ARI: 1.00 Sil:  -1.00 Acc: 1.00 Recall: 1.00 Precision: 1.00

Built-in fuzzy evaluattion metrics:

kcens.CalcFuzzyScore()

Out come:

Fuzzy scores PC:1.00 NPC:1.00 FHV↓:0.02 FS↓:-2000.00 XB↓:0.11 BH↓:0.06 BWS:-2000.00 FPC:3.50 SIL_R:0.70 FSIL:0.70 MPO:12.15 NPE:0.01 PE:0.01 PEB:0.01

References:

To be updated

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

lshkcenters-1.0.3.tar.gz (23.7 kB view hashes)

Uploaded Source

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