Class MEC<T>
- java.lang.Object
-
- smile.clustering.PartitionClustering<T>
-
- smile.clustering.MEC<T>
-
- All Implemented Interfaces:
- java.io.Serializable, Clustering<T>
public class MEC<T> extends PartitionClustering<T> implements java.io.Serializable
Nonparametric Minimum Conditional Entropy Clustering. This method performs very well especially when the exact number of clusters is unknown. The method can also correctly reveal the structure of data and effectively identify outliers simultaneously.The clustering criterion is based on the conditional entropy H(C | x), where C is the cluster label and x is an observation. According to Fano's inequality, we can estimate C with a low probability of error only if the conditional entropy H(C | X) is small. MEC also generalizes the criterion by replacing Shannon's entropy with Havrda-Charvat's structural α-entropy. Interestingly, the minimum entropy criterion based on structural α-entropy is equal to the probability error of the nearest neighbor method when α= 2. To estimate p(C | x), MEC employs Parzen density estimation, a nonparametric approach.
MEC is an iterative algorithm starting with an initial partition given by any other clustering methods, e.g. k-means, CLARNAS, hierarchical clustering, etc. Note that a random initialization is NOT appropriate.
References
- Haifeng Li, Keshu Zhang, and Tao Jiang. Minimum Entropy Clustering and Applications to Gene Expression Analysis. CSB, 2004.
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from interface smile.clustering.Clustering
OUTLIER
-
-
Constructor Summary
Constructors Constructor and Description MEC(T[] data, Distance<T> distance, int k, double radius)Constructor.MEC(T[] data, Metric<T> distance, int k, double radius)Constructor.MEC(T[] data, RNNSearch<T,T> nns, int k, double radius, int[] y)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description doubleentropy()Returns the cluster conditional entropy.doublegetRadius()Returns the radius of neighborhood.intpredict(T x)Cluster a new instance.java.lang.StringtoString()-
Methods inherited from class smile.clustering.PartitionClustering
getClusterLabel, getClusterSize, getNumClusters, seed, seed
-
-
-
-
Constructor Detail
-
MEC
public MEC(T[] data, Distance<T> distance, int k, double radius)
Constructor. Clustering the data.- Parameters:
data- the dataset for clustering.distance- the distance measure for neighborhood search.k- the number of clusters. Note that this is just a hint. The final number of clusters may be less.radius- the neighborhood radius.
-
MEC
public MEC(T[] data, Metric<T> distance, int k, double radius)
Constructor. Clustering the data.- Parameters:
data- the dataset for clustering.distance- the distance measure for neighborhood search.k- the number of clusters. Note that this is just a hint. The final number of clusters may be less.radius- the neighborhood radius.
-
MEC
public MEC(T[] data, RNNSearch<T,T> nns, int k, double radius, int[] y)
Constructor. Clustering the data.- Parameters:
data- the dataset for clustering.nns- the neighborhood search data structure.k- the number of clusters. Note that this is just a hint. The final number of clusters may be less.radius- the neighborhood radius.y- the initial clustering labels, which could be produced by any other clustering methods.
-
-
Method Detail
-
entropy
public double entropy()
Returns the cluster conditional entropy.
-
getRadius
public double getRadius()
Returns the radius of neighborhood.
-
predict
public int predict(T x)
Cluster a new instance.- Specified by:
predictin interfaceClustering<T>- Parameters:
x- a new instance.- Returns:
- the cluster label. Note that it may be
Clustering.OUTLIER.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-
DataMelt 3.0 © DataMelt by jWork.ORG