V
- vector datatypepublic class KMedoidsEM<V> extends AbstractDistanceBasedAlgorithm<V,Clustering<MedoidModel>> implements ClusteringAlgorithm<Clustering<MedoidModel>>
Modifier and Type | Class and Description |
---|---|
static class |
KMedoidsEM.Parameterizer<V>
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 String |
KEY
Key for statistics logging.
|
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(DistanceFunction<? super V> 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> 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
private static final String KEY
protected int k
KMeans.K_ID
.protected int maxiter
KMeans.MAXITER_ID
.protected KMedoidsInitialization<V> initializer
public KMedoidsEM(DistanceFunction<? super V> 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> 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>>
Copyright © 2015 ELKI Development Team, Lehr- und Forschungseinheit für Datenbanksysteme, Ludwig-Maximilians-Universität München. License information.