 |
ExtensionsGetMedoidTInstance Method |
Returns the medoid of a given
ClusterTInstance, i.e., a representative object whose dissimilarity
to all the instances in the cluster is minimal.
Namespace:
Aglomera
Assembly:
Aglomera (in Aglomera.dll) Version: 1.1.0
Syntaxpublic static TInstance GetMedoid<TInstance>(
this Cluster<TInstance> cluster,
IDissimilarityMetric<TInstance> metric
)
where TInstance : Object, IComparable<TInstance>
Request Example
View SourceParameters
- cluster
- Type: AglomeraClusterTInstance
The cluster whose medoid we want to retrieve. - metric
- Type: AglomeraIDissimilarityMetricTInstance
The dissimilarity metric used to compare elements in the cluster, i.e., to calculate the distance between them.
Type Parameters
- TInstance
- The type of instance considered.
Return Value
Type:
TInstanceThe medoid of the given cluster. If the cluster has two elements, it returns the first element of the cluster.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
ClusterTInstance. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
Remarks
"Medoids are representative objects of a data set or a cluster with a data set whose average dissimilarity to all
the objects in the cluster is minimal. Medoids are similar in concept to means or centroids, but medoids are
always restricted to be members of the data set. Medoids are most commonly used on data when a mean or centroid
cannot be defined, such as graphs. They are also used in contexts where the centroid is not representative of the
dataset like in images and 3-D trajectories and gene expression (where while the data is sparse the medoid need
not be). These are also of interest while wanting to find a representative using some distance other than squared
euclidean distance (for instance in movie-ratings)."
https://en.wikipedia.org/wiki/Medoid
See Also