|
Carrot2 Framework
API Specification |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.carrot2.filter.trc.carrot.filter.cluster.rough.clustering.AbstractKMeansAlgorithm
public abstract class AbstractKMeansAlgorithm
A boiler-plate implementation of generic K-Means algorithm. Soft (fuzzy) membership allowed.
| Field Summary | |
|---|---|
protected static Timer |
timer
|
| Constructor Summary | |
|---|---|
AbstractKMeansAlgorithm()
|
|
| Method Summary | |
|---|---|
protected abstract void |
calculateClusterRepresentation()
Calculate representation for cluster (usually in form of a centroid) |
void |
cluster()
Execute clustering |
protected abstract void |
doClustering()
Main step in clustering algorithm : assign objects to clusters |
abstract double[][] |
getClusterRepresentation()
Return cluster's representation vector as a matrix Rows = vectors |
abstract int[][] |
getClusters()
Return clusters as a form of binary matrix (n rows-objects * k colums-clusters) Cell[i,j] = 1 iff object i belongs to cluster j |
abstract double[][] |
getMembership()
Return cluster membership matrix Colums = cluster membership vector |
abstract int[] |
getUnclassified()
Return indices of unclassified objects |
abstract double[] |
getUnclassifiedCentroid()
Return centroid of unclassified objects |
abstract double[] |
getUnclassifiedMembership()
Return membership vector for unclassified objects; Length of vector = number of unclassified object |
protected abstract void |
prepareInitialClusters()
Prepare initial clusters |
protected abstract boolean |
stopCondition()
Stop condition for algorithm |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final Timer timer
| Constructor Detail |
|---|
public AbstractKMeansAlgorithm()
| Method Detail |
|---|
protected abstract void prepareInitialClusters()
protected abstract void doClustering()
protected abstract void calculateClusterRepresentation()
protected abstract boolean stopCondition()
true when algorithm should stop processingpublic void cluster()
public abstract int[][] getClusters()
public abstract double[][] getMembership()
public abstract double[][] getClusterRepresentation()
public abstract int[] getUnclassified()
public abstract double[] getUnclassifiedCentroid()
public abstract double[] getUnclassifiedMembership()
|
Please refer to project documentation at
http://project.carrot2.org |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||