Moodle PHP Documentation 4.2
Moodle 4.2.8 (Build: 20240610) (2d41ac46f45)
Phpml\Clustering\FuzzyCMeans Class Reference
Inheritance diagram for Phpml\Clustering\FuzzyCMeans:
Phpml\Clustering\Clusterer

Public Member Functions

 __construct (int $clustersNumber, float $fuzziness=2.0, float $epsilon=1e-2, int $maxIterations=100)
 
 cluster (array $samples)
 
 getMembershipMatrix ()
 

Protected Member Functions

 generateRandomMembership (int $rows, int $cols)
 
 getDistanceCalc (int $row, int $col)
 
 getMembershipRowTotal (int $row, int $col, bool $multiply)
 
 getObjective ()
 The objective is to minimize the distance between all data points and all cluster centers.
 
 initClusters ()
 
 updateClusters ()
 
 updateMembershipMatrix ()
 

Constructor & Destructor Documentation

◆ __construct()

Phpml\Clustering\FuzzyCMeans::__construct ( int $clustersNumber,
float $fuzziness = 2.0,
float $epsilon = 1e-2,
int $maxIterations = 100 )
Exceptions
InvalidArgumentException

Member Function Documentation

◆ cluster()

Phpml\Clustering\FuzzyCMeans::cluster ( array $samples)

◆ getObjective()

Phpml\Clustering\FuzzyCMeans::getObjective ( )
protected

The objective is to minimize the distance between all data points and all cluster centers.

This method returns the summation of all these distances


The documentation for this class was generated from the following file: