|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectanl.aida.algo.SimilarityCluster<T>
public class SimilarityCluster<T>
Encapsulates a centroid vector and a collection of items of type T and their similarity (0 to 1) with that centroid vector.
Field Summary | |
---|---|
private java.util.Map<T,anl.aida.util.ObjScore<T>> |
items
|
private java.lang.String[] |
labels
|
private java.lang.String |
labelString
|
private float[] |
vector
|
Constructor Summary | |
---|---|
SimilarityCluster(float[] vector,
java.lang.String... labels)
Creates a SimilarityCluster with the specified vector and label. |
Method Summary | |
---|---|
protected void |
addItem(T item,
float similarity)
|
float[] |
getCentroid()
Gets the vector for the cluster centroid. |
java.lang.String |
getCentroidLabel()
Gets the label for this cluster. |
int |
getItemCount()
The number of items in this cluster. |
float |
getSimilarity(T item)
Gets the similarity score for the specified item with respect to the cluster centroid. |
java.lang.Iterable<anl.aida.util.ObjScore<T>> |
items()
Gets an iterable over all the items and score in this cluster. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private float[] vector
private java.lang.String labelString
private java.lang.String[] labels
private java.util.Map<T,anl.aida.util.ObjScore<T>> items
Constructor Detail |
---|
public SimilarityCluster(float[] vector, java.lang.String... labels)
vector
- the centroids vectorlabels
- the centroids labelsMethod Detail |
---|
protected void addItem(T item, float similarity)
public java.lang.String getCentroidLabel()
getCentroidLabel
in interface Cluster<T>
public int getItemCount()
getItemCount
in interface Cluster<T>
public float[] getCentroid()
getCentroid
in interface Cluster<T>
public float getSimilarity(T item)
getSimilarity
in interface Cluster<T>
item
- the item whose score we want.
public java.lang.Iterable<anl.aida.util.ObjScore<T>> items()
Cluster
items
in interface Cluster<T>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |