|
Sautrela | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.gtts.sautrela.vq.ClusterSet
public class ClusterSet
A set of Clusters sharing a Collection of multidimensional data.
| Constructor Summary | |
|---|---|
ClusterSet()
Creates a new empty ClusterSet |
|
ClusterSet(java.util.List<DoubleData> codebook)
Creates a new ClusterSet with initial empty Clusters from a CodeBook. |
|
ClusterSet(java.net.URL cdbkURL,
boolean binary)
Creates a new ClusterSet with initial enpty Clusters from a codebook file (containing dumped Data). |
|
| Method Summary | |
|---|---|
void |
addCluster(Cluster c)
Adds a new Cluster and all its data to this ClusterSet. |
void |
addCluster(java.util.Collection<Cluster> c)
Adds all the Cluster elements in the specified Collection to this ClusterSet. |
void |
addData(java.util.Collection<double[]> c)
Adds all the data elements in the specified Collection to this ClusterSet. |
void |
addData(double[] d)
Adds new data to this ClusterSet. |
void |
doClustering()
Removes data from all Clusters and does Clustering with all the data avaiable in this ClusterSet. |
void |
dumpCodebook(java.io.File file,
boolean binary)
|
void |
emptyClusters()
Removes all data from all the contained Clusters. |
java.util.List<Cluster> |
getClusters()
Returns all the Clusters contained in this ClusterSet. |
java.util.Collection<double[]> |
getData()
Returns all the data contained in this ClusterSet. |
double |
getDistorsion()
Returns the current distorsion of the ClusterSet (the sum over all the Clusters). |
double[] |
getDistorsions()
Returns a new vector containing all the distorsions of the ClusterSet. |
void |
lbg(double epsi,
int maxiter,
boolean elbg)
Applies LBG algorithm to this ClusterSet. |
int |
nearest(double[] d)
Returns the nearest Cluster's index for a given data. |
int |
nearestTo(int i)
Returns the nearest Cluster's index for a Cluster in the ClusterSet. |
void |
removeData()
Removes all data both from this ClusterSet an all the contained Clusters. |
void |
setRandomClusters(int size)
Creates new Clusters up to the desired size using this ClusterSet's random data elements as centroids. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ClusterSet()
public ClusterSet(java.util.List<DoubleData> codebook)
throws DataProcessorException
codebook - a List of DoubleData containing the initial codebook
DataProcessorException - when the constructor fails with the given parameters
public ClusterSet(java.net.URL cdbkURL,
boolean binary)
throws DataProcessorException
Data). Dumped Data
if filtered and only DoubleData elements are loaded.
cdbkURL - initial codebook URLbinary - dumped binary data flag. If set to true, Data is supposed to be
serialized. If set to false, data is supposed to be xml text.
DataProcessorException - when the constructor fails with the given parameters| Method Detail |
|---|
public void dumpCodebook(java.io.File file,
boolean binary)
throws DataProcessorException
DataProcessorExceptionpublic void addData(double[] d)
d - data to be addedpublic void addData(java.util.Collection<double[]> c)
c - data elements to be added.public void addCluster(Cluster c)
c - the Cluster to be added.public void addCluster(java.util.Collection<Cluster> c)
c - Cluster elements to be added.public java.util.Collection<double[]> getData()
public java.util.List<Cluster> getClusters()
public void removeData()
public void emptyClusters()
public double getDistorsion()
public double[] getDistorsions()
public void doClustering()
public int nearest(double[] d)
getClusters()
d - the given data element
public int nearestTo(int i)
getClusters()
i - the index of the given cluster
public void lbg(double epsi,
int maxiter,
boolean elbg)
epsi - convergence constant. The convergence is reached when
(dold-dnew)/dnew <= epsi , being dold
and dnew the previous and current iteration distorsions.maxiter - maximun number of iterations.elbg - if true, the Enhanced LBG algorithm is used.
in each iteration, for each Cluster with distorsion smaller than the mean ("low" Cluster):
public void setRandomClusters(int size)
size - the number of Clusters that will contain this ClusterSet
|
Sautrela | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||