py4k-means
K-Means Python Library
Getting Started
This project is simply implementation of K-Means clustering algorithm in python programming language.
Prerequisites
Numpy & Pandas
Installing
The easiest way to install py4k-means is using pip
pip install py4k-means
Usage
There is only 1 public method of k_means class. It is cluster. cluster method takes 3 argument namely x, k, and max_iter. x is the data its self, k is the number of cluster we are aiming to, while max_iter is maximum iteration. By default max_iter is 10. The return of this method is pandas DataFrame with 1 column addition, it is the label column obtained by K-Means algorithm
from py4k_means.cluster import k_means
import numpy as np
import matplotlib.pyplot as plt
x = [np.random.uniform(-5,5 ,2) for i in range(500)]
km = k_means()
y = km.cluster(x,4,20)
plt.scatter(y['x0'],y['x1'],c=y['label'],cmap='rainbow')
plt.show()
Metadata
Release files for py4k-means 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| py4k_means-0.0.1.tar.gz | 2.4 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| py4k_means-0.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 5.1 kB
Release files / py4k_means-0.0.1.tar.gz
| Download URL | py4k_means-0.0.1.tar.gz |
|---|---|
| Size | 2.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
968802cf62e81700178a4f912a6d399b32963d437ce5b07c8feaf3705eaf9401
|
|
BLAKE2b-256 checksum How to use checksums |
b0f68c19c19c91ee722549eeb14996e966240b3f9dea2d7e3495b2da78af0bcc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.1
|
Release files / py4k_means-0.0.1-py3-none-any.whl
| Download URL | py4k_means-0.0.1-py3-none-any.whl |
|---|---|
| Size | 2.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ac1c72b5a61c255c29c889d06a7d41af566b33c09cb994accb45cbd07e36b892
|
|
BLAKE2b-256 checksum How to use checksums |
8e55dabd47d363185ae15e51d569a38345d1909e20474f06feb96e8ffc42666e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.1
|
Security for py4k-means 0.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.