T
- Type of featurespublic class FeatureVectorCentroidsResult<T extends FeatureVector> extends Object implements SpatialClusters<T>, CentroidsProvider<T>
SpatialClusterer
that just produces a flat set of
centroids in the form of FeatureVector
s.Modifier and Type | Field and Description |
---|---|
T[] |
centroids
The centroids of the clusters
|
CLUSTER_HEADER
Constructor and Description |
---|
FeatureVectorCentroidsResult() |
Modifier and Type | Method and Description |
---|---|
String |
asciiHeader()
Header for ascii input.
|
byte[] |
binaryHeader()
Header for binary input.
|
HardAssigner<T,float[],IntFloatPair> |
defaultHardAssigner()
Get the default hard assigner for this clusterer.
|
boolean |
equals(Object obj) |
T[] |
getCentroids() |
int |
numClusters()
Get the number of clusters.
|
int |
numDimensions()
Get the data dimensionality
|
void |
readASCII(Scanner br)
Read internal state from in.
|
void |
readBinary(DataInput in)
Read internal state from in.
|
String |
toString() |
void |
writeASCII(PrintWriter writer)
Write the content of this as ascii to out.
|
void |
writeBinary(DataOutput out)
Write the content of this as binary to out.
|
public T extends FeatureVector[] centroids
public FeatureVectorCentroidsResult()
public String asciiHeader()
ReadableASCII
asciiHeader
in interface ReadableASCII
asciiHeader
in interface WriteableASCII
public byte[] binaryHeader()
ReadableBinary
binaryHeader
in interface ReadableBinary
binaryHeader
in interface WriteableBinary
public void readASCII(Scanner br) throws IOException
ReadableASCII
readASCII
in interface ReadableASCII
br
- source to read from.IOException
- an error reading inputpublic void readBinary(DataInput in) throws IOException
ReadableBinary
readBinary
in interface ReadableBinary
in
- source to read from.IOException
- an error reading inputpublic void writeASCII(PrintWriter writer) throws IOException
WriteableASCII
writeASCII
in interface WriteableASCII
writer
- sink to write toIOException
- an error writing to outpublic void writeBinary(DataOutput out) throws IOException
WriteableBinary
writeBinary
in interface WriteableBinary
out
- sink to write toIOException
- an error writing to outpublic T[] getCentroids()
getCentroids
in interface CentroidsProvider<T extends FeatureVector>
public HardAssigner<T,float[],IntFloatPair> defaultHardAssigner()
SpatialClusters
defaultHardAssigner
in interface SpatialClusters<T extends FeatureVector>
public int numDimensions()
SpatialClusters
numDimensions
in interface SpatialClusters<T extends FeatureVector>
public int numClusters()
SpatialClusters
numClusters
in interface SpatialClusters<T extends FeatureVector>