public class Clusterer extends Object
Constructor and Description |
---|
Clusterer(int numberOfClusters,
int maximumIterations,
String modelName,
String siddhiAppName,
int dimensionality)
Initialize no.
|
Modifier and Type | Method and Description |
---|---|
void |
buildModel(List<DataPoint> dataPointsArray) |
void |
cluster(List<DataPoint> dataPointsArray)
Perform clustering
|
Object[] |
getAssociatedCentroidInfo(DataPoint currentDatapoint)
similar to findAssociatedCluster method but return an Object[] array with the distance
to closest centroid and the coordinates of the closest centroid
|
boolean |
isModelInitialTrained() |
String |
printClusterList(List<Cluster> clusterList) |
void |
setModel(KMeansModel m) |
void |
setModelInitialTrained(boolean b) |
void |
train(LinkedList<DataPoint> dataPointsArray,
int numberOfEventsToRetrain,
double decayRate,
ExecutorService executorService) |
void |
updateCluster(List<DataPoint> dataPointsArray,
double decayRate)
After the first clustering this method can be used to incrementally update centroidList
in real time.
|
public boolean isModelInitialTrained()
public void setModelInitialTrained(boolean b)
public void train(LinkedList<DataPoint> dataPointsArray, int numberOfEventsToRetrain, double decayRate, ExecutorService executorService)
public void setModel(KMeansModel m)
public void updateCluster(List<DataPoint> dataPointsArray, double decayRate)
dataPointsArray
- decayRate
- should be in [0,1]public Object[] getAssociatedCentroidInfo(DataPoint currentDatapoint)
currentDatapoint
- the input dataPoint for which the closest centroid needs to be foundCopyright © 2017 WSO2. All rights reserved.