V
- vector datatypeD
- distance value typepublic class KMedoidsEM<V,D extends NumberDistance<D,?>> extends AbstractDistanceBasedAlgorithm<V,D,Clustering<MedoidModel>> implements ClusteringAlgorithm<Clustering<MedoidModel>>
Modifier and Type | Class and Description |
---|---|
static class |
KMedoidsEM.Parameterizer<V,D extends NumberDistance<D,?>>
Parameterization class.
|
Modifier and Type | Field and Description |
---|---|
protected KMedoidsInitialization<V> |
initializer
Method to choose initial means.
|
protected int |
k
Holds the value of
KMeans.K_ID . |
private static Logging |
LOG
The logger for this class.
|
protected int |
maxiter
Holds the value of
KMeans.MAXITER_ID . |
DISTANCE_FUNCTION_ID
Constructor and Description |
---|
KMedoidsEM(PrimitiveDistanceFunction<? super V,D> distanceFunction,
int k,
int maxiter,
KMedoidsInitialization<V> initializer)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
assignToNearestCluster(ArrayDBIDs means,
Mean[] mdist,
List<? extends ModifiableDBIDs> clusters,
DistanceQuery<V,D> distQ)
Returns a list of clusters.
|
TypeInformation[] |
getInputTypeRestriction()
Get the input type restriction used for negotiating the data query.
|
protected Logging |
getLogger()
Get the (STATIC) logger for this class.
|
Clustering<MedoidModel> |
run(Database database,
Relation<V> relation)
Run k-medoids
|
getDistanceFunction
makeParameterDistanceFunction, run
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
run
private static final Logging LOG
protected int k
KMeans.K_ID
.protected int maxiter
KMeans.MAXITER_ID
.protected KMedoidsInitialization<V> initializer
public KMedoidsEM(PrimitiveDistanceFunction<? super V,D> distanceFunction, int k, int maxiter, KMedoidsInitialization<V> initializer)
distanceFunction
- distance functionk
- k parametermaxiter
- Maxiter parameterinitializer
- Function to generate the initial meanspublic Clustering<MedoidModel> run(Database database, Relation<V> relation)
database
- Databaserelation
- relation to useprotected boolean assignToNearestCluster(ArrayDBIDs means, Mean[] mdist, List<? extends ModifiableDBIDs> clusters, DistanceQuery<V,D> distQ)
means
- a list of k meansmdist
- Mean distancesclusters
- cluster assignmentdistQ
- distance querypublic TypeInformation[] getInputTypeRestriction()
AbstractAlgorithm
getInputTypeRestriction
in interface Algorithm
getInputTypeRestriction
in class AbstractAlgorithm<Clustering<MedoidModel>>
protected Logging getLogger()
AbstractAlgorithm
getLogger
in class AbstractAlgorithm<Clustering<MedoidModel>>