Skip to main content

Clustering high-dimensional data with Minkowski distance

Project description

CI

LKMeans

LKMeans is a Python library that extends the functionality of the KMeans algorithm by allowing clusterization using the Minkowski metric instead of the traditional Euclidean distance. The Minkowski metric provides better quality performance in certain scenarios, making LKMeans a valuable tool for clustering analysis.

Features

  • Clusterization using the Minkowski metric
  • Improved quality performance compared to traditional KMeans
  • Easy integration into existing machine learning pipelines

Installation

You can install LKMeans:

  1. From source
export PYTHONPATH=${PYTHONPATH}:$(pwd)/lkmeans
  1. From PyPI
pip install lkmeans

Usage

Using LKMeans is straightforward. Here's a simple example that demonstrates how to use the library:

import numpy as np

from lkmeans import LKMeans

# Generate some random data
X = np.random.rand(100, 2)

# Create an instance of LKMeans with the desired number of clusters and Minkowski parameter
lkmeans = LKMeans(n_clusters=3, p=0.8)

# Fit the model to the data
labels = lkmeans.fit_predict(X)
centers = lkmeans.cluster_centers_
inertia = lkmeans.inertia_

print(labels, centers, inertia)

In this example, we first import the LKMeans class from the LKMeans library. We create an instance of LKMeans with the desired number of clusters (n_clusters) and the desired Minkowski distance parameter (p), and fit the model to the data using the fit method.

Contributing

Contributions to LKMeans are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request on the GitHub repository.

License

LKMeans is licensed under the MIT License. See the LICENSE file for more information.

Cite

@misc{LKMeans2023,
  author = {Aleksei Trutnev},
  title  = {Clustering high-dimensional data with Minkowski distance},
  year   = {2023},
  url    = {https://github.com/alexgiving/LKMeans}
}

Contact

For any questions or inquiries, please contact alexgiving@mail.ru.

Enjoy clustering with LKMeans!

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

lkmeans-0.0.2.tar.gz (12.2 kB view details)

Uploaded Source

Built Distribution

lkmeans-0.0.2-py3-none-any.whl (17.7 kB view details)

Uploaded Python 3

File details

Details for the file lkmeans-0.0.2.tar.gz.

File metadata

  • Download URL: lkmeans-0.0.2.tar.gz
  • Upload date:
  • Size: 12.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for lkmeans-0.0.2.tar.gz
Algorithm Hash digest
SHA256 57e5c61d264366b78b7d04c7b1b5ca862a07e01937e9c9209e51abcf5ad4903d
MD5 fe4f51b6d31d62cc14585799cbe8a99d
BLAKE2b-256 1e384d67fbb3af99cb034bcfa03a9ff8caf09b1e4517bb0c97f0ff728cbf1f15

See more details on using hashes here.

File details

Details for the file lkmeans-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: lkmeans-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 17.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for lkmeans-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 944e68951e51fdd6b59589e727913b1f77a3707cbb867157280a3a2c4e359961
MD5 29336183fc93795fbcdb5824a4716552
BLAKE2b-256 a009715804bcec402b72e3859a0559a92482f7183f992bc831b563045960b788

See more details on using hashes here.

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