org.neuroph.nnet.learning.kmeans
Class Cluster
- java.lang.Object
-
- org.neuroph.nnet.learning.kmeans.Cluster
-
public class Cluster extends java.lang.ObjectThis class represents a single cluster, with corresponding centroid and assigned vectors
-
-
Constructor Summary
Constructors Constructor and Description Cluster()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidassignVector(KVector vector)Assignes vector to this cluster.booleanequals(java.lang.Object obj)Returns true if two clusters have same centroiddouble[]getAvgSum()Calculate and return avg sum vector for all vectorsKVectorgetCentroid()java.util.List<KVector>getPoints()inthashCode()voidremovePoint(KVector point)voidsetCentroid(KVector centroid)intsize()Returns number of vectors assigned to this cluster.
-
-
-
Method Detail
-
getCentroid
public KVector getCentroid()
-
setCentroid
public void setCentroid(KVector centroid)
-
removePoint
public void removePoint(KVector point)
-
getPoints
public java.util.List<KVector> getPoints()
-
getAvgSum
public double[] getAvgSum()
Calculate and return avg sum vector for all vectors- Returns:
- avg sum vector
-
equals
public boolean equals(java.lang.Object obj)
Returns true if two clusters have same centroid- Overrides:
equalsin classjava.lang.Object- Parameters:
obj-- Returns:
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
assignVector
public void assignVector(KVector vector)
Assignes vector to this cluster.- Parameters:
vector- vector to assign
-
size
public int size()
Returns number of vectors assigned to this cluster.- Returns:
- number of vectors assigned to this cluster
-
-
DMelt 3.0 © DataMelt by jWork.ORG