public abstract class LanceWilliamsDissimilarity extends DistanceMetricDissimilarity implements UpdatableClusterDissimilarity
dissimilarity(java.util.List, java.util.List)
and
dissimilarity(java.util.Set, java.util.Set, double[][])
methods
will work and produce the correct results, their performance will likely be
less than desired had they be computed directly.dm
Constructor and Description |
---|
LanceWilliamsDissimilarity(DistanceMetric dm)
Creates a new LW dissimilarity measure using the given metric as the base distance between individual points.
|
LanceWilliamsDissimilarity(LanceWilliamsDissimilarity toCopy)
Copy constructor
|
Modifier and Type | Method and Description |
---|---|
protected abstract double |
aConst(boolean iFlag,
int ni,
int nj,
int nk)
This method computes the value of the α variable.
|
protected abstract double |
bConst(int ni,
int nj,
int nk)
This method computes the value of the β variable.
|
protected abstract double |
cConst(int ni,
int nj,
int nk)
This method computes the value of the γ variable.
|
abstract LanceWilliamsDissimilarity |
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 LanceWilliamsDissimilarity(DistanceMetric dm)
dm
- the base metric to measure dissimilarity from.public LanceWilliamsDissimilarity(LanceWilliamsDissimilarity toCopy)
toCopy
- the object to copyprotected abstract double aConst(boolean iFlag, int ni, int nj, int nk)
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 abstract double bConst(int ni, int nj, int nk)
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 abstract double cConst(int ni, int nj, int nk)
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 kpublic double dissimilarity(List<DataPoint> a, List<DataPoint> b)
ClusterDissimilarity
dissimilarity
in interface ClusterDissimilarity
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
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
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
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)
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 kpublic abstract LanceWilliamsDissimilarity clone()
clone
in interface ClusterDissimilarity
clone
in interface UpdatableClusterDissimilarity
clone
in class DistanceMetricDissimilarity
Copyright © 2017. All rights reserved.