V
- vector datatype@Title(value="Partioning Around Medoids") @Priority(value=100) @Reference(authors="L. Kaufman, P. J. Rousseeuw",title="Clustering by means of Medoids",booktitle="Statistical Data Analysis Based on the L1-Norm and Related Methods",bibkey="books/misc/KauRou87") @Reference(authors="L. Kaufman, P. J. Rousseeuw",title="Partitioning Around Medoids (Program PAM)",booktitle="Finding Groups in Data: An Introduction to Cluster Analysis",url="https://doi.org/10.1002/9780470316801.ch2",bibkey="doi:10.1002/9780470316801.ch2") public class KMedoidsPAM<V> extends AbstractDistanceBasedAlgorithm<V,Clustering<MedoidModel>> implements ClusteringAlgorithm<Clustering<MedoidModel>>
Reference:
L. Kaufman, P. J. Rousseeuw
Clustering by means of Medoids
Statistical Data Analysis Based on the L1-Norm and Related Methods
Modifier and Type | Class and Description |
---|---|
protected static class |
KMedoidsPAM.Instance
Instance for a single dataset.
|
static class |
KMedoidsPAM.Parameterizer<V>
Parameterization class.
|
Modifier and Type | Field and Description |
---|---|
protected KMedoidsInitialization<V> |
initializer
Method to choose initial means.
|
protected int |
k
The number of clusters to produce.
|
private static Logging |
LOG
The logger for this class.
|
protected int |
maxiter
The maximum number of iterations.
|
ALGORITHM_ID
DISTANCE_FUNCTION_ID
Constructor and Description |
---|
KMedoidsPAM(DistanceFunction<? super V> distanceFunction,
int k,
int maxiter,
KMedoidsInitialization<V> initializer)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
TypeInformation[] |
getInputTypeRestriction()
Get the input type restriction used for negotiating the data query.
|
protected Logging |
getLogger()
Get the (STATIC) logger for this class.
|
protected ArrayModifiableDBIDs |
initialMedoids(DistanceQuery<V> distQ,
DBIDs ids)
Choose the initial medoids.
|
Clustering<MedoidModel> |
run(Database database,
Relation<V> relation)
Run k-medoids
|
protected void |
run(DistanceQuery<V> distQ,
DBIDs ids,
ArrayModifiableDBIDs medoids,
WritableIntegerDataStore assignment)
Run the main algorithm.
|
getDistanceFunction
run
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
run
private static final Logging LOG
protected int k
protected int maxiter
protected KMedoidsInitialization<V> initializer
public KMedoidsPAM(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 ArrayModifiableDBIDs initialMedoids(DistanceQuery<V> distQ, DBIDs ids)
distQ
- Distance queryids
- IDs to choose fromprotected void run(DistanceQuery<V> distQ, DBIDs ids, ArrayModifiableDBIDs medoids, WritableIntegerDataStore assignment)
distQ
- Distance queryids
- IDs to processmedoids
- Current medoidsassignment
- Cluster assignment outputpublic TypeInformation[] getInputTypeRestriction()
AbstractAlgorithm
getInputTypeRestriction
in interface Algorithm
getInputTypeRestriction
in class AbstractAlgorithm<Clustering<MedoidModel>>
protected Logging getLogger()
AbstractAlgorithm
getLogger
in class AbstractAlgorithm<Clustering<MedoidModel>>
Copyright © 2019 ELKI Development Team. License information.