Package moa.clusterers.clustree
Class ClusKernel
- java.lang.Object
-
- moa.AbstractMOAObject
-
- moa.cluster.Cluster
-
- moa.cluster.SphereCluster
-
- moa.cluster.CFCluster
-
- moa.clusterers.clustree.ClusKernel
-
- All Implemented Interfaces:
Serializable
,MOAObject
public class ClusKernel extends CFCluster
Representation of an Entry in the tree- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static double
EPSILON
Numeric epsilon.static double
MIN_VARIANCE
-
Fields inherited from class moa.cluster.CFCluster
LS, N, radiusFactor, SS
-
-
Constructor Summary
Constructors Modifier Constructor Description ClusKernel(double[] point, int dim)
A constructor that makes a Kernel which just represents the given point.protected
ClusKernel(int numberDimensions)
Constructor of the Cluster.protected
ClusKernel(ClusKernel other)
Instantiates a copy of the given cluster.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(ClusKernel other)
Adds the given cluster to this cluster, without making this cluster older.protected void
aggregate(ClusKernel other, long timeDifference, double negLambda)
Make this cluster older bei weighting it and add to this cluster the given cluster.double
calcDistance(ClusKernel other)
Calculate the distance to this other cluster.protected void
clear()
Remove all points from this cluster.double[]
getCenter()
CFCluster
getCF()
double
getInclusionProbability(Instance instance)
Returns the probability of the given point belonging to this cluster.double
getRadius()
See interfaceCluster
double[]
getVarianceVector()
double
getWeight()
See interfaceCluster
protected boolean
isEmpty()
Check if this cluster is empty or not.protected void
makeOlder(long timeDifference, double negLambda)
Make this cluster older.protected void
overwriteOldCluster(ClusKernel other)
Overwrites the LS, SS and weightedN in this cluster to the values of the given cluster but adds N and classCount of the given cluster to this one.-
Methods inherited from class moa.cluster.CFCluster
add, addVectors, getN, setN
-
Methods inherited from class moa.cluster.SphereCluster
combine, getCenterDistance, getCenterDistance, getClusterSpecificInfo, getDistanceVector, getDistanceVector, getHullDistance, merge, overlapRadiusDegree, overlapSave, sample, setCenter, setRadius, setWeight
-
Methods inherited from class moa.cluster.Cluster
getDescription, getGroundTruth, getId, getInfo, getMeasureValue, isGroundTruth, setGroundTruth, setId, setMeasureValue, setMeasureValue
-
Methods inherited from class moa.AbstractMOAObject
copy, copy, measureByteSize, measureByteSize, toString
-
-
-
-
Field Detail
-
EPSILON
public static final double EPSILON
Numeric epsilon.- See Also:
- Constant Field Values
-
MIN_VARIANCE
public static final double MIN_VARIANCE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ClusKernel
public ClusKernel(double[] point, int dim)
A constructor that makes a Kernel which just represents the given point.- Parameters:
point
- The point to be converted into a corresponding Kernel.dim
- The number of classes possible for points in this experiment(Tree
).
-
ClusKernel
protected ClusKernel(int numberDimensions)
Constructor of the Cluster.- Parameters:
numberDimensions
- Dimensionality of the points added that can be added to this cluster experiment(Tree
).
-
ClusKernel
protected ClusKernel(ClusKernel other)
Instantiates a copy of the given cluster.- Parameters:
other
- TheCluster
of which we make a copy.
-
-
Method Detail
-
add
public void add(ClusKernel other)
Adds the given cluster to this cluster, without making this cluster older.- Parameters:
other
-
-
aggregate
protected void aggregate(ClusKernel other, long timeDifference, double negLambda)
Make this cluster older bei weighting it and add to this cluster the given cluster. If we want to add somethin to the cluster, but don't want to weight it, we should use the functionadd(Cluster)
.- Parameters:
other
- The other cluster to be added to this one.timeDifference
- The time elapsed between the last update of theEntry
to which this cluster belongs and the update that caused the call to this function.negLambda
- A parameter needed to weight the cluster.- See Also:
add(ClusKernel)
-
makeOlder
protected void makeOlder(long timeDifference, double negLambda)
Make this cluster older. This means multiplying weighted N, LS and SS with a weight factor given by the time difference and the parameter negLambda.- Parameters:
timeDifference
- The time elapsed between this current update and the last one.negLambda
-
-
calcDistance
public double calcDistance(ClusKernel other)
Calculate the distance to this other cluster. The other cluster is normaly just a single data point(i.e. N = 1).- Parameters:
other
- The other cluster to which the distance is calculated.- Returns:
- The distance between this cluster and the other.
-
isEmpty
protected boolean isEmpty()
Check if this cluster is empty or not.- Returns:
true
if the cluster has no data points,false
otherwise.
-
clear
protected void clear()
Remove all points from this cluster.
-
overwriteOldCluster
protected void overwriteOldCluster(ClusKernel other)
Overwrites the LS, SS and weightedN in this cluster to the values of the given cluster but adds N and classCount of the given cluster to this one. This function is useful when the weight of an entry becomes to small, and we want to forget the information of the old points.- Parameters:
other
- The cluster that should overwrite the information.
-
getWeight
public double getWeight()
Description copied from class:CFCluster
See interfaceCluster
- Overrides:
getWeight
in classCFCluster
- Returns:
- The weight.
- See Also:
Cluster.getWeight()
-
getCenter
public double[] getCenter()
-
getInclusionProbability
public double getInclusionProbability(Instance instance)
Description copied from class:Cluster
Returns the probability of the given point belonging to this cluster.- Specified by:
getInclusionProbability
in classCFCluster
- Returns:
- a value between 0 and 1
-
getRadius
public double getRadius()
See interfaceCluster
- Specified by:
getRadius
in classCFCluster
- Returns:
- The radius of the cluster.
- See Also:
SphereCluster.getRadius()
-
getVarianceVector
public double[] getVarianceVector()
-
-