Package moa.cluster
Class CFCluster
- java.lang.Object
-
- moa.AbstractMOAObject
-
- moa.cluster.Cluster
-
- moa.cluster.SphereCluster
-
- moa.cluster.CFCluster
-
- All Implemented Interfaces:
Serializable
,MOAObject
- Direct Known Subclasses:
ClusKernel
,ClustreamKernel
,DensityGrid
,MicroCluster
,NonConvexCluster
public abstract class CFCluster extends SphereCluster
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description double[]
LS
Linear sum of all the points added to the cluster.protected double
N
Number of points in the cluster.protected double
radiusFactor
double[]
SS
Squared sum of all the points added to the cluster.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
add(CFCluster cluster)
static void
addVectors(double[] a1, double[] a2)
Adds the second array to the first array element by element.double[]
getCenter()
abstract CFCluster
getCF()
abstract double
getInclusionProbability(Instance instance)
Returns the probability of the given point belonging to this cluster.double
getN()
abstract double
getRadius()
See interfaceCluster
double
getWeight()
See interfaceCluster
void
setN(double N)
-
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
-
-
-
-
Constructor Detail
-
CFCluster
public CFCluster(Instance instance, int dimensions)
Instantiates an empty kernel with the given dimensionality.- Parameters:
dimensions
- The number of dimensions of the points that can be in this kernel.
-
CFCluster
protected CFCluster(int dimensions)
-
CFCluster
public CFCluster(double[] center, int dimensions)
-
CFCluster
public CFCluster(CFCluster cluster)
-
-
Method Detail
-
add
public void add(CFCluster cluster)
-
getCF
public abstract CFCluster getCF()
-
getCenter
public double[] getCenter()
- Overrides:
getCenter
in classSphereCluster
- Returns:
- this kernels' center
-
getInclusionProbability
public abstract double getInclusionProbability(Instance instance)
Description copied from class:Cluster
Returns the probability of the given point belonging to this cluster.- Overrides:
getInclusionProbability
in classSphereCluster
- Returns:
- a value between 0 and 1
-
getRadius
public abstract double getRadius()
See interfaceCluster
- Overrides:
getRadius
in classSphereCluster
- Returns:
- The radius of the cluster.
-
getWeight
public double getWeight()
See interfaceCluster
- Overrides:
getWeight
in classSphereCluster
- Returns:
- The weight.
- See Also:
Cluster.getWeight()
-
setN
public void setN(double N)
-
getN
public double getN()
-
addVectors
public static void addVectors(double[] a1, double[] a2)
Adds the second array to the first array element by element. The arrays must have the same length.- Parameters:
a1
- Vector to which the second vector is added.a2
- Vector to be added. This vector does not change.
-
-