PHP Class Phpml\Clustering\KMeans\Cluster

Inheritance: extends Point, implements IteratorAggregat\IteratorAggregate, implements Countabl\Countable
Show file Open project: php-ai/php-ml

Protected Properties

Property Type Description
$points SplObjectStorag\SplObjectStorage | Point[]
$space Space

Public Methods

Method Description
__construct ( Space $space, array $coordinates )
attach ( Point $point ) : Point
attachAll ( SplObjectStorage $points )
count ( ) : mixed
detach ( Point $point ) : Point
detachAll ( SplObjectStorage $points )
getIterator ( ) : Point[] | SplObjectStorag\SplObjectStorage
getPoints ( ) : array
toArray ( ) : array
updateCentroid ( )

Method Details

__construct() public method

public __construct ( Space $space, array $coordinates )
$space Space
$coordinates array

attach() public method

public attach ( Point $point ) : Point
$point Point
return Point

attachAll() public method

public attachAll ( SplObjectStorage $points )
$points SplObjectStorage

count() public method

public count ( ) : mixed
return mixed

detach() public method

public detach ( Point $point ) : Point
$point Point
return Point

detachAll() public method

public detachAll ( SplObjectStorage $points )
$points SplObjectStorage

getIterator() public method

public getIterator ( ) : Point[] | SplObjectStorag\SplObjectStorage
return Point[] | SplObjectStorag\SplObjectStorage

getPoints() public method

public getPoints ( ) : array
return array

toArray() public method

public toArray ( ) : array
return array

updateCentroid() public method

public updateCentroid ( )

Property Details

$points protected property

protected SplObjectStorage,SplObjectStorag|Point[],Phpml\Clustering\KMeans $points
return SplObjectStorag\SplObjectStorage | Point[]

$space protected property

protected Space,Phpml\Clustering\KMeans $space
return Space