V
- vector datatype@Title(value="Partioning Around Medoids") @Reference(title="Clustering by means of Medoids", authors="Kaufman, L. and Rousseeuw, P.J.", booktitle="Statistical Data Analysis Based on the L1-Norm and Related Methods") public class KMedoidsPAM<V> extends AbstractDistanceBasedAlgorithm<V,Clustering<MedoidModel>> implements ClusteringAlgorithm<Clustering<MedoidModel>>
Clustering my means of Medoids
Kaufman, L. and Rousseeuw, P.J.
in: Statistical Data Analysis Based on the L1-Norm and Related Methods
Modifier and Type | Class and Description |
---|---|
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 String |
KEY
Key for statistics logging.
|
private static Logging |
LOG
The logger for this class.
|
protected int |
maxiter
The maximum number of iterations.
|
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 |
---|---|
protected double |
assignToNearestCluster(ArrayDBIDs means,
DBIDs ids,
WritableDoubleDataStore nearest,
WritableDoubleDataStore second,
WritableIntegerDataStore assignment,
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
|
protected void |
runPAMOptimization(DistanceQuery<V> distQ,
DBIDs ids,
ArrayModifiableDBIDs medoids,
WritableIntegerDataStore assignment)
Run the PAM optimization phase.
|
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
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 void runPAMOptimization(DistanceQuery<V> distQ, DBIDs ids, ArrayModifiableDBIDs medoids, WritableIntegerDataStore assignment)
distQ
- Distance queryids
- IDs to processmedoids
- Medoids listassignment
- Cluster assignmentprotected double assignToNearestCluster(ArrayDBIDs means, DBIDs ids, WritableDoubleDataStore nearest, WritableDoubleDataStore second, WritableIntegerDataStore assignment, DistanceQuery<V> distQ)
means
- Object centroidsids
- Object idsnearest
- Distance to nearest medoidsecond
- Distance to second nearest medoidassignment
- 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.