@Bindable(prefix="BisectingKMeansClusteringAlgorithm", inherit=CommonAttributes.class) public class BisectingKMeansClusteringAlgorithm extends ProcessingComponentBase implements IClusteringAlgorithm
Modifier and Type | Field and Description |
---|---|
int |
clusterCount
The number of clusters to create.
|
List<Cluster> |
clusters |
List<Document> |
documents |
int |
labelCount
Label count.
|
LabelFormatter |
labelFormatter
Cluster label formatter, contains bindable attributes.
|
TermDocumentMatrixBuilder |
matrixBuilder
Term-document matrix builder for the algorithm, contains bindable attributes.
|
TermDocumentMatrixReducer |
matrixReducer
Term-document matrix reducer for the algorithm, contains bindable attributes.
|
int |
maxIterations
The maximum number of k-means iterations to perform.
|
MultilingualClustering |
multilingualClustering
A helper for performing multilingual clustering.
|
int |
partitionCount
Partition count.
|
IPreprocessingPipeline |
preprocessingPipeline
Common preprocessing tasks handler.
|
boolean |
useDimensionalityReduction
Use dimensionality reduction.
|
Constructor and Description |
---|
BisectingKMeansClusteringAlgorithm() |
Modifier and Type | Method and Description |
---|---|
protected void |
cluster(LanguageCode language)
Perform clustering for a given language.
|
void |
process()
Performs the processing required to fulfill the request.
|
afterProcessing, beforeProcessing, dispose, getContext, getSharedExecutor, init
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
afterProcessing, beforeProcessing, dispose, init
@Processing @Input @Required @Internal @Attribute(key="documents", inherit=true) public List<Document> documents
@Processing @Output @Internal @Attribute(key="clusters", inherit=true) public List<Cluster> clusters
@Processing @Input @Attribute @IntRange(min=2) @Group(value="Clusters") @Level(value=BASIC) @Label(value="Cluster count") public int clusterCount
@Processing @Input @Attribute @IntRange(min=1) @Group(value="K-means") @Level(value=BASIC) @Label(value="Maximum iterations") public int maxIterations
@Processing @Input @Attribute @Group(value="K-means") @Level(value=BASIC) @Label(value="Use dimensionality reduction") public boolean useDimensionalityReduction
true
, k-means will be applied on the
dimensionality-reduced term-document matrix with the number of dimensions being
equal to twice the number of requested clusters. If the number of dimensions is
lower than the number of input documents, reduction will not be performed.
If false
, the k-means will
be performed directly on the original term-document matrix.@Processing @Input @Attribute @IntRange(min=2, max=10) @Group(value="K-means") @Level(value=BASIC) @Label(value="Partition count") public int partitionCount
@Processing @Input @Attribute @IntRange(min=1, max=10) @Group(value="Clusters") @Level(value=BASIC) @Label(value="Label count") public int labelCount
@Input @Attribute @Internal @Level(value=ADVANCED) public IPreprocessingPipeline preprocessingPipeline
public final TermDocumentMatrixBuilder matrixBuilder
public final TermDocumentMatrixReducer matrixReducer
public final LabelFormatter labelFormatter
public final MultilingualClustering multilingualClustering
public void process() throws ProcessingException
IProcessingComponent
process
in interface IProcessingComponent
process
in class ProcessingComponentBase
ProcessingException
- when processing failed. If thrown, the
IProcessingComponent.afterProcessing()
method will be called and the component will
be ready to accept further requests or to be disposed of. Finally, the
exception will be rethrown from the controller method that caused the
component to perform processing.protected void cluster(LanguageCode language)