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 details)

Uploaded Source

File details

Details for the file lshkcenters-1.0.3.tar.gz.

File metadata

  • Download URL: lshkcenters-1.0.3.tar.gz
  • Upload date:
  • Size: 23.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.7.8

File hashes

Hashes for lshkcenters-1.0.3.tar.gz
Algorithm Hash digest
SHA256 a0040fb3f099cb13cd39f65881e83516cf336432d93c90228e9a8e9e32a4dad6
MD5 45f2cf2e1a2709789d31d32521f285fd
BLAKE2b-256 526e74b1d729e315d6d4b627e66156864186a2ccd11dd054640e7f17e5d3d7ed

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page