Package moa.cluster
Class Cluster
- java.lang.Object
-
- moa.AbstractMOAObject
-
- moa.cluster.Cluster
-
- All Implemented Interfaces:
Serializable
,MOAObject
- Direct Known Subclasses:
SphereCluster
public abstract class Cluster extends AbstractMOAObject
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Cluster()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract double[]
getCenter()
protected void
getClusterSpecificInfo(ArrayList<String> infoTitle, ArrayList<String> infoValue)
void
getDescription(StringBuilder sb, int i)
Returns a string representation of this object.double
getGroundTruth()
double
getId()
abstract double
getInclusionProbability(Instance instance)
Returns the probability of the given point belonging to this cluster.String
getInfo()
String
getMeasureValue(String measureKey)
abstract double
getWeight()
Returns the weight of this cluster, not neccessarily normalized.boolean
isGroundTruth()
abstract Instance
sample(Random random)
Samples this cluster by returning a point from inside it.void
setGroundTruth(double truth)
void
setId(double id)
void
setMeasureValue(String measureKey, double value)
void
setMeasureValue(String measureKey, String value)
-
Methods inherited from class moa.AbstractMOAObject
copy, copy, measureByteSize, measureByteSize, toString
-
-
-
-
Method Detail
-
getCenter
public abstract double[] getCenter()
- Returns:
- the center of the cluster
-
getWeight
public abstract double getWeight()
Returns the weight of this cluster, not neccessarily normalized. It could, for instance, simply return the number of points contined in this cluster.- Returns:
- the weight
-
getInclusionProbability
public abstract double getInclusionProbability(Instance instance)
Returns the probability of the given point belonging to this cluster.- Parameters:
instance
-- Returns:
- a value between 0 and 1
-
getDescription
public void getDescription(StringBuilder sb, int i)
Description copied from interface:MOAObject
Returns a string representation of this object. Used inAbstractMOAObject.toString
to give a string representation of the object.- Parameters:
sb
- the stringbuilder to add the descriptioni
- the number of characters to indent
-
setId
public void setId(double id)
-
getId
public double getId()
-
isGroundTruth
public boolean isGroundTruth()
-
setGroundTruth
public void setGroundTruth(double truth)
-
getGroundTruth
public double getGroundTruth()
-
sample
public abstract Instance sample(Random random)
Samples this cluster by returning a point from inside it.- Parameters:
random
- a random number source- Returns:
- an Instance that lies inside this cluster
-
setMeasureValue
public void setMeasureValue(String measureKey, double value)
-
getClusterSpecificInfo
protected void getClusterSpecificInfo(ArrayList<String> infoTitle, ArrayList<String> infoValue)
-
getInfo
public String getInfo()
-
-