Skip to main content

K-means clustering with outlier removal numpy implementation

Project description

KMOR Numpy

The python implementation for k-means clustering with outlier removal from the paper written by Guojun Gan et al. [1]

Installation

pip install kmor

You can also install by conda

conda install -c ksunhokim kmor

Example

import numpy as np
from kmor import kmor
X = np.array([
    [1,0,0],
    [0,1,0],
    [0,0,1],
    [0,0,100]
])
U = kmor(X, 1)
print(U) # [0,0,0,1]

The outliers are assigned to the extra cluster k.

Documentation

kmor(X, k, y, nc0, max_iteration, gamma)

Parameter Description
X Your data.
k Number of clusters.
y Parameter for outlier detection. (default=3) Increase this to make outlier removal subtle.
nc0 Maximum percentage of your data that can be assigned to outlier cluster. (default=0.1)
max_iteration Maximum number of iterations.
gamma Used to check the convergence.

References

[1] Gan, Guojun, and Michael Kwok-Po Ng. "K-means clustering with outlier removal." Pattern Recognition Letters 90 (2017): 8-14.

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

kmor-1.0.7.tar.gz (2.7 kB view details)

Uploaded Source

File details

Details for the file kmor-1.0.7.tar.gz.

File metadata

  • Download URL: kmor-1.0.7.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3.post20200325 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.6

File hashes

Hashes for kmor-1.0.7.tar.gz
Algorithm Hash digest
SHA256 ee4e6c74ea1b134b4228573d837c3799920907b3acab1474a59071c7e45b27be
MD5 89183d60ab8b68e513123abf2f195e46
BLAKE2b-256 1023e28f3f875a141f65afe95b753afc33d6d34682fb029f538202637f485ef2

See more details on using hashes here.

Supported by

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