Download the PHP package medansoftware/kmeans-algorithm-php without Composer

On this page you can find all versions of the php package medansoftware/kmeans-algorithm-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package kmeans-algorithm-php

PHP K-Means Library

A PHP implementation of the K-Means clustering algorithm.

Requirements

Installation

Install the library using Composer:

Usage

Include Composer's autoloader:

Example 1: Two-dimensional data

This example uses two attributes (A and B) and divides the data into two clusters.

Example 2: One-dimensional data

This example uses a single attribute and divides the data into three clusters.

Initial Centroids

Initial centroids can be selected from existing data points by using their indexes:

An array of indexes can also be used:

Alternatively, centroid values can be provided directly:

If no centroids are provided, the library automatically selects distinct data points as initial centroids:

Iterations and Convergence

The maximum number of iterations can be configured with:

The algorithm automatically stops when the centroids converge or when the maximum number of iterations is reached.

The number of iterations executed can be obtained using:

You can check whether the algorithm has converged using:

Results

Get the final centroids:

Get the initial centroids:

Get the cluster logs:

Get all logs:

Get all results:

References

Made with ❤️ + ☕ ~ Agung Dirgantara


All versions of kmeans-algorithm-php with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package medansoftware/kmeans-algorithm-php contains the following files

Loading the files please wait ...