V
- vector datatypeD
- distance value type@Title(value="Partioning Around Medoids") @Reference(title="Clustering my means of Medoids", authors="Kaufman, L. and Rousseeuw, P.J.", booktitle="Statistical Data Analysis Based on the L_1\u2013Norm and Related Methods") public class KMedoidsPAM<V,D extends NumberDistance<D,?>> extends AbstractDistanceBasedAlgorithm<V,D,Clustering<MedoidModel>> implements ClusteringAlgorithm<Clustering<MedoidModel>>
Clustering my means of Medoids
Kaufman, L. and Rousseeuw, P.J.
in: Statistical Data Analysis Based on the L_1–Norm and Related Methods
Modifier and Type | Class and Description |
---|---|
static class |
KMedoidsPAM.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 |
---|
KMedoidsPAM(PrimitiveDistanceFunction<? super V,D> distanceFunction,
int k,
int maxiter,
KMedoidsInitialization<V> initializer)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
assignToNearestCluster(ArrayDBIDs means,
DBIDs ids,
WritableDoubleDataStore second,
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 KMedoidsPAM(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, DBIDs ids, WritableDoubleDataStore second, List<? extends ModifiableDBIDs> clusters, DistanceQuery<V,D> distQ)
means
- Object centroidsids
- Object idssecond
- Distance to second nearest medoidclusters
- 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>>