com.rapidminer.operator.clustering
Class ClusterModel

java.lang.Object
  extended by com.rapidminer.operator.AbstractIOObject
      extended by com.rapidminer.operator.ResultObjectAdapter
          extended by com.rapidminer.operator.clustering.ClusterModel
All Implemented Interfaces:
IOObject, ResultObject, Saveable, LoggingHandler, java.io.Serializable
Direct Known Subclasses:
CentroidClusterModel, FlatFuzzyClusterModel

public class ClusterModel
extends ResultObjectAdapter

This class is the standard flat cluster model, using the example ids to remember which examples were assigned to which cluster. This information is stored within the single clusters. Since this, the id attribute needs to be unchanged when cluster model is applied onto an example set.

Author:
Sebastian Land
See Also:
Serialized Form

Field Summary
static int UNASSIGNABLE
           
 
Constructor Summary
ClusterModel(int k)
           
 
Method Summary
 void checkCapabilities(ExampleSet exampleSet)
           
 Cluster getCluster(int i)
           
 int[] getClusterAssignments(ExampleSet exampleSet)
          This method returns an array with the indices or the cluster for all examples in the set.
 int getClusterIndexOfId(java.lang.Object id)
          This method returns the index of the cluster, this Id's example has been assigned to.
 java.util.Collection<Cluster> getClusters()
           
 java.lang.String getExtension()
          Returns the default extension in file choosers.
 java.lang.String getFileDescription()
          Returns the file description used in file choosers.
 java.lang.String getName()
          The default implementation returns the classname without package.
 int getNumberOfClusters()
           
 void setClusterAssignments(int[] clusterId, ExampleSet exampleSet)
           
 java.lang.String toString()
           
 
Methods inherited from class com.rapidminer.operator.ResultObjectAdapter
addAction, getActions, getResultIcon, getVisualizationComponent, isSavable, log, logError, logNote, logWarning, save, toHTML, toResultString
 
Methods inherited from class com.rapidminer.operator.AbstractIOObject
copy, getLog, getSource, initWriting, read, setLoggingHandler, setSource, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.rapidminer.operator.IOObject
copy, getLog, getSource, setLoggingHandler, setSource, write
 

Field Detail

UNASSIGNABLE

public static final int UNASSIGNABLE
See Also:
Constant Field Values
Constructor Detail

ClusterModel

public ClusterModel(int k)
Method Detail

getNumberOfClusters

public int getNumberOfClusters()

setClusterAssignments

public void setClusterAssignments(int[] clusterId,
                                  ExampleSet exampleSet)

getClusterAssignments

public int[] getClusterAssignments(ExampleSet exampleSet)
This method returns an array with the indices or the cluster for all examples in the set. This will work with new examples, if centroid based clustering has been used before. Otherwise new examples cannot be assigned.


getClusterIndexOfId

public int getClusterIndexOfId(java.lang.Object id)
This method returns the index of the cluster, this Id's example has been assigned to. Please note, that this can only be applied to examples included in the clustering process. New examples might be assigned to clusters using the getClusterAssignments method, if and only if the cluster model supports this. Currently only centroid based cluster models do.


getCluster

public Cluster getCluster(int i)

getClusters

public java.util.Collection<Cluster> getClusters()

getExtension

public java.lang.String getExtension()
Description copied from interface: Saveable
Returns the default extension in file choosers.


getFileDescription

public java.lang.String getFileDescription()
Description copied from interface: Saveable
Returns the file description used in file choosers.


checkCapabilities

public void checkCapabilities(ExampleSet exampleSet)
                       throws OperatorException
Throws:
OperatorException

getName

public java.lang.String getName()
Description copied from class: ResultObjectAdapter
The default implementation returns the classname without package.

Specified by:
getName in interface ResultObject
Overrides:
getName in class ResultObjectAdapter

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2001-2009 by Rapid-I