|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectfrog.Kmeans
public class Kmeans
Kmeans is a Quantizer implementation that utilizes the k-means algorithm (as well as k-means++ if requested) to select appropriate representatives (that is, build its codebook).
| Field Summary | |
|---|---|
protected int |
k
|
protected Accel3D[] |
means
|
protected Accel3D[] |
oldMeans
|
protected Vector<Accel3D> |
trainingSet
|
| Fields inherited from interface frog.Quantizer |
|---|
KMEANS, NUM_TYPES_SUPPORTED |
| Constructor Summary | |
|---|---|
Kmeans(KmeansParameters params,
Vector<Accel3D> in)
Constructs a Kmeans quantizer with a given set of k-means parameters and a 3D acceleration data set. |
|
Kmeans(Vector<Accel3D> in)
Constructs a Kmeans quantizer with a given 3D acceleration data set. |
|
| Method Summary | |
|---|---|
Vector<Accel3D> |
getDataSet()
Accessor for the data set utilized by this Quantizer. |
Accel3D[] |
getMeans()
Returns the array of Accel3Ds making up the means for this Quantizer. |
int |
getNumMeans()
Accessor for the number of means. |
int |
getType()
Accessor for the Quantizer type index. |
void |
setDataSet(Vector<Accel3D> data)
Sets the data set to use in this Quantizer. |
int |
size()
For Kmeans, the size corresponds to the number of means (k). |
int |
translate(Accel3D acc)
For Kmeans, translates to the index of the closest mean determined by the k-means algorithm. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected int k
protected Accel3D[] oldMeans
protected Accel3D[] means
protected Vector<Accel3D> trainingSet
| Constructor Detail |
|---|
public Kmeans(Vector<Accel3D> in)
in - a set of Accel3D values
public Kmeans(KmeansParameters params,
Vector<Accel3D> in)
params - quantizing parametersin - a set of Accel3D values| Method Detail |
|---|
public int translate(Accel3D acc)
translate in interface Quantizeracc - The acceleration vector to translate (quantize)
public int getNumMeans()
public int size()
size in interface Quantizerpublic Accel3D[] getMeans()
public Vector<Accel3D> getDataSet()
Quantizer
getDataSet in interface Quantizerpublic void setDataSet(Vector<Accel3D> data)
Quantizer
setDataSet in interface Quantizerdata - the data set to assign to this Quantizerpublic int getType()
Quantizer
getType in interface Quantizer
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||