PHPackages                             yudhasubki/simple-kmeans-lib - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. yudhasubki/simple-kmeans-lib

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

yudhasubki/simple-kmeans-lib
============================

Just simple library kmeans clustering with PHP

430PHP

Since Jul 1Pushed 6y agoCompare

[ Source](https://github.com/yudhasubki/PHP-KMeans-Lib)[ Packagist](https://packagist.org/packages/yudhasubki/simple-kmeans-lib)[ RSS](/packages/yudhasubki-simple-kmeans-lib/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

PHP KMeans Algorithm Library
============================

[](#php-kmeans-algorithm-library)

K-means clustering is a method of vector quantization, originally from signal processing, that is popular for cluster analysis in data mining.

Installing
----------

[](#installing)

Run `composer require "yudhasubki/simple-kmeans-lib":"dev-master"`

Usage
-----

[](#usage)

Use the class in folder service then make an instance, example:

```
determineCluster($distanceCenteroid);
$joinAttributes    = $cluster->joinClusterAttributes($clusterGrouping);
$meanEachRow       = $cluster->createNewCenteroid();

$creatingNewCenteroid = $cluster->calculateMean($meanEachRow);
$result = $cluster->countObjectCenteroid($creatingNewCenteroid);
$cluster->determineCluster($result);
```

Usage
-----

[](#usage-1)

open terminal :

```
php /your/path/directory/your_file_name.php

```

or running on your browser

```
http://127.0.0.1:8001/your_file_name.php

```

Contributing
------------

[](#contributing)

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License
-------

[](#license)

[MIT](https://choosealicense.com/licenses/mit/)

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/90346544e92f3018809b4294459323b1b370dcf1bdb48e094768f608aed40712?d=identicon)[yudhasubki](/maintainers/yudhasubki)

---

Top Contributors

[![yudhasubki](https://avatars.githubusercontent.com/u/17976036?v=4)](https://github.com/yudhasubki "yudhasubki (15 commits)")

### Embed Badge

![Health badge](/badges/yudhasubki-simple-kmeans-lib/health.svg)

```
[![Health](https://phpackages.com/badges/yudhasubki-simple-kmeans-lib/health.svg)](https://phpackages.com/packages/yudhasubki-simple-kmeans-lib)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
