public class SingleLinkDissimilarity extends LanceWilliamsDissimilarity implements UpdatableClusterDissimilarity
dm
Constructor and Description |
---|
SingleLinkDissimilarity()
Creates a new SingleLinkDissimilarity using the
EuclideanDistance |
SingleLinkDissimilarity(DistanceMetric dm)
Creates a new SingleLinkDissimilarity
|
SingleLinkDissimilarity(SingleLinkDissimilarity toCopy)
Copy constructor
|
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.
|
SingleLinkDissimilarity |
clone() |
double |
dissimilarity(int ni,
int nj,
int nk,
double d_ij,
double d_ik,
double d_jk)
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,
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.
|
distance
createDistanceMatrix, getDistance, setDistance
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
distance
public SingleLinkDissimilarity()
EuclideanDistance
public SingleLinkDissimilarity(DistanceMetric dm)
dm
- the distance metric to use between individual pointspublic SingleLinkDissimilarity(SingleLinkDissimilarity toCopy)
toCopy
- the object to copypublic SingleLinkDissimilarity 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)
public double dissimilarity(int ni, int nj, int nk, double d_ij, double d_ik, double d_jk)
LanceWilliamsDissimilarity
dissimilarity
in class LanceWilliamsDissimilarity
ni
- the number of items in the cluster represented by inj
- the number of items in the cluster represented by jnk
- the number of items in the cluster represented by kd_ij
- the distance between clusters i and jd_ik
- the distance between clusters i and kd_jk
- the distance between clusters j and kprotected 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.