Package elki.index.tree.betula.features
Class BIRCHCF
- java.lang.Object
-
- elki.index.tree.betula.features.BIRCHCF
-
- All Implemented Interfaces:
FeatureVector<java.lang.Number>
,NumberVector
,SpatialComparable
,AsClusterFeature
,ClusterFeature
public class BIRCHCF extends java.lang.Object implements ClusterFeature
Clustering Feature of BIRCH, only for comparison- Since:
- 0.8.0
- Author:
- Erich Schubert
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
BIRCHCF.Factory
Factory for making cluster features.
-
Field Summary
Fields Modifier and Type Field Description (package private) double[]
ls
Linear sum.(package private) int
n
Number of objects(package private) double
ss
Sum of squares (see original thesis, this is a scalar).-
Fields inherited from interface elki.data.FeatureVector
TYPE
-
Fields inherited from interface elki.data.NumberVector
ATTRIBUTE_SEPARATOR, FIELD, FIELD_1D, FIELD_2D, VARIABLE_LENGTH
-
-
Constructor Summary
Constructors Constructor Description BIRCHCF(int dimensionality)
Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addToStatistics(NumberVector nv)
Add NumberVector to CFvoid
addToStatistics(BIRCHCF other)
void
addToStatistics(ClusterFeature other)
Add other CF to CFdouble
centroid(int i)
Returns the mean of the specified dimension.double[][]
covariance()
returns the covariance matrixint
getDimensionality()
The dimensionality of the vector space where of this FeatureVector of V is an element.int
getWeight()
Return the weightdouble
ls(int i)
Get the linear sum of component i.void
resetStatistics()
Resets all statistics of CFdouble
sumdev()
Returns the total sum of Deviations.static double
sumOfSquares(NumberVector v)
Compute the sum of squares of a vector.double
sumOfSquaresOfSums()
Sum over all dimensions of squares of linear sums.double
sumOfSumOfSquares()
Sum over all dimensions of sums of squares.double[]
toArray()
Returns a double array copy of this vector.double
variance()
Returns the total variance.double
variance(int i)
Returns the variance in the specified dimension.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface elki.index.tree.betula.features.ClusterFeature
doubleValue, getCF, longValue
-
Methods inherited from interface elki.data.FeatureVector
toString
-
Methods inherited from interface elki.data.NumberVector
byteValue, floatValue, getMax, getMin, getValue, intValue, shortValue
-
-
-
-
Method Detail
-
addToStatistics
public void addToStatistics(NumberVector nv)
Description copied from interface:ClusterFeature
Add NumberVector to CF- Specified by:
addToStatistics
in interfaceClusterFeature
- Parameters:
nv
- NumberVector
-
addToStatistics
public void addToStatistics(ClusterFeature other)
Description copied from interface:ClusterFeature
Add other CF to CF- Specified by:
addToStatistics
in interfaceClusterFeature
- Parameters:
other
- other CF
-
addToStatistics
public void addToStatistics(BIRCHCF other)
-
resetStatistics
public void resetStatistics()
Description copied from interface:ClusterFeature
Resets all statistics of CF- Specified by:
resetStatistics
in interfaceClusterFeature
-
centroid
public double centroid(int i)
Description copied from interface:ClusterFeature
Returns the mean of the specified dimension.- Specified by:
centroid
in interfaceClusterFeature
- Parameters:
i
- dimension- Returns:
- mean of this dimension
-
sumOfSumOfSquares
public double sumOfSumOfSquares()
Sum over all dimensions of sums of squares.- Returns:
- Sum of SS
-
sumOfSquaresOfSums
public double sumOfSquaresOfSums()
Sum over all dimensions of squares of linear sums.- Returns:
- Sum of LS
-
getDimensionality
public int getDimensionality()
Description copied from interface:FeatureVector
The dimensionality of the vector space where of this FeatureVector of V is an element.- Specified by:
getDimensionality
in interfaceFeatureVector<java.lang.Number>
- Specified by:
getDimensionality
in interfaceSpatialComparable
- Returns:
- the number of dimensions of this FeatureVector of V
-
sumOfSquares
public static double sumOfSquares(NumberVector v)
Compute the sum of squares of a vector.- Parameters:
v
- Vector- Returns:
- Sum of squares
-
ls
public double ls(int i)
Get the linear sum of component i.- Parameters:
i
- Component- Returns:
- linear sum
-
variance
public double variance(int i)
Description copied from interface:ClusterFeature
Returns the variance in the specified dimension.- Specified by:
variance
in interfaceClusterFeature
- Parameters:
i
- dimension- Returns:
- variance in this dimension.
-
getWeight
public int getWeight()
Description copied from interface:ClusterFeature
Return the weight- Specified by:
getWeight
in interfaceClusterFeature
- Returns:
- weight of CF
-
variance
public double variance()
Description copied from interface:ClusterFeature
Returns the total variance.- Specified by:
variance
in interfaceClusterFeature
- Returns:
- variance.
-
sumdev
public double sumdev()
Description copied from interface:ClusterFeature
Returns the total sum of Deviations.- Specified by:
sumdev
in interfaceClusterFeature
- Returns:
- Sum of Deviations.
-
covariance
public double[][] covariance()
Description copied from interface:ClusterFeature
returns the covariance matrix- Specified by:
covariance
in interfaceClusterFeature
- Returns:
- covariance
-
toArray
public double[] toArray()
Description copied from interface:NumberVector
Returns a double array copy of this vector.- Specified by:
toArray
in interfaceNumberVector
- Returns:
- Copy as
double[]
-
-