public class CentroidDissimilarity extends LanceWilliamsDissimilarity implements UpdatableClusterDissimilarity
dm
Constructor and Description |
---|
CentroidDissimilarity()
Creates a new CentroidDissimilarity that used the
EuclideanDistance |
CentroidDissimilarity(DistanceMetric dm)
Creates a new CentroidDissimilarity
|
Modifier and Type | Method and Description |
---|---|
protected double |
aConst(boolean iFlag,
int ni,
int nj,
int nk)
This method computes the value of the α variable.
|
protected double |
bConst(int ni,
int nj,
int nk)
This method computes the value of the β variable.
|
protected double |
cConst(int ni,
int nj,
int nk)
This method computes the value of the γ variable.
|
CentroidDissimilarity |
clone() |
double |
dissimilarity(int i,
int ni,
int j,
int nj,
double[][] distanceMatrix)
Provides the notion of dissimilarity between two sets of points, that may
not have the same number of points.
|
double |
dissimilarity(int i,
int ni,
int j,
int nj,
int k,
int nk,
double[][] distanceMatrix)
Provides the notion of dissimilarity between two sets of points, that may
not have the same number of points.
|
double |
dissimilarity(List<DataPoint> a,
List<DataPoint> b)
Provides the notion of dissimilarity between two sets of points, that may
not have the same number of points.
|
double |
dissimilarity(Set<Integer> a,
Set<Integer> b,
double[][] distanceMatrix)
Provides the notion of dissimilarity between two sets of points, that may
not have the same number of points.
|
dissimilarity
distance
createDistanceMatrix, getDistance, setDistance
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
distance
public CentroidDissimilarity()
EuclideanDistance
public CentroidDissimilarity(DistanceMetric dm)
dm
- the distance measure to use between individual pointspublic CentroidDissimilarity clone()
clone
in interface ClusterDissimilarity
clone
in interface UpdatableClusterDissimilarity
clone
in class LanceWilliamsDissimilarity
public double dissimilarity(List<DataPoint> a, List<DataPoint> b)
ClusterDissimilarity
dissimilarity
in interface ClusterDissimilarity
dissimilarity
in class LanceWilliamsDissimilarity
a
- the first cluster of pointsb
- the second cluster of pointspublic double dissimilarity(Set<Integer> a, Set<Integer> b, double[][] distanceMatrix)
ClusterDissimilarity
dissimilarity
in interface ClusterDissimilarity
dissimilarity
in class LanceWilliamsDissimilarity
a
- the first set of indices of the original data set that are in a
cluster, which map to distanceMatrixb
- the second set of indices of the original data set that are in a
cluster, which map to distanceMatrixdistanceMatrix
- the upper triangual distance matrix as created by
AbstractClusterDissimilarity.createDistanceMatrix(jsat.DataSet, jsat.clustering.dissimilarity.ClusterDissimilarity)
public double dissimilarity(int i, int ni, int j, int nj, double[][] distanceMatrix)
UpdatableClusterDissimilarity
dissimilarity
in interface UpdatableClusterDissimilarity
dissimilarity
in class LanceWilliamsDissimilarity
i
- the index of cluster i's distance in the original data setni
- the number of items in the cluster represented by ij
- the index of cluster j's distance in the original data setnj
- the number of items in the cluster represented by jdistanceMatrix
- a distance matrix originally created by
AbstractClusterDissimilarity.createDistanceMatrix(jsat.DataSet,
jsat.clustering.dissimilarity.ClusterDissimilarity)
public double dissimilarity(int i, int ni, int j, int nj, int k, int nk, double[][] distanceMatrix)
UpdatableClusterDissimilarity
dissimilarity
in interface UpdatableClusterDissimilarity
dissimilarity
in class LanceWilliamsDissimilarity
i
- the index of cluster i's distance in the original data setni
- the number of items in the cluster represented by ij
- the index of cluster j's distance in the original data setnj
- the number of items in the cluster represented by jk
- the index of cluster k's distance in the original data setnk
- the number of items in the cluster represented by k
a distance matrix originally created by
AbstractClusterDissimilarity.createDistanceMatrix(jsat.DataSet,
jsat.clustering.dissimilarity.ClusterDissimilarity)
protected double aConst(boolean iFlag, int ni, int nj, int nk)
LanceWilliamsDissimilarity
aConst
in class LanceWilliamsDissimilarity
iFlag
- true indicates that αi is the
value to compute, false indicated that αj
should be computed.ni
- the number of points that make up cluster inj
- the number of points that make up cluster jnk
- the number of points that make up cluster kprotected double bConst(int ni, int nj, int nk)
LanceWilliamsDissimilarity
bConst
in class LanceWilliamsDissimilarity
ni
- the number of points that make up cluster inj
- the number of points that make up cluster jnk
- the number of points that make up cluster kprotected double cConst(int ni, int nj, int nk)
LanceWilliamsDissimilarity
cConst
in class LanceWilliamsDissimilarity
ni
- the number of points that make up cluster inj
- the number of points that make up cluster jnk
- the number of points that make up cluster kCopyright © 2017. All rights reserved.