程序包 weka.clusterers
类 AbstractClusterer
java.lang.Object
weka.clusterers.AbstractClusterer
- 所有已实现的接口:
Serializable
,Cloneable
,Clusterer
,CapabilitiesHandler
,RevisionHandler
- 直接已知子类:
AbstractDensityBasedClusterer
,CLOPE
,DBSCAN
,HierarchicalClusterer
,OPTICS
,RandomizableClusterer
,RandomizableSingleClustererEnhancer
,SingleClustererEnhancer
public abstract class AbstractClusterer
extends Object
implements Clusterer, Cloneable, Serializable, CapabilitiesHandler, RevisionHandler
Abstract clusterer.
- 版本:
- $Revision: 5537 $
- 作者:
- Mark Hall (mhall@cs.waikato.ac.nz)
- 另请参阅:
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明abstract void
buildClusterer
(Instances data) Generates a clusterer.int
clusterInstance
(Instance instance) Classifies a given instance.double[]
distributionForInstance
(Instance instance) Predicts the cluster memberships for a given instance.static Clusterer
Creates a new instance of a clusterer given it's class name and (optional) arguments to pass to it's setOptions method.Returns the Capabilities of this clusterer.Returns the revision string.static Clusterer[]
makeCopies
(Clusterer model, int num) Creates copies of the current clusterer.static Clusterer
Creates a deep copy of the given clusterer using serialization.abstract int
Returns the number of clusters.
-
构造器详细资料
-
AbstractClusterer
public AbstractClusterer()
-
-
方法详细资料
-
buildClusterer
Generates a clusterer. Has to initialize all fields of the clusterer that are not being set via options.- 指定者:
buildClusterer
在接口中Clusterer
- 参数:
data
- set of instances serving as training data- 抛出:
Exception
- if the clusterer has not been generated successfully
-
clusterInstance
Classifies a given instance. Either this or distributionForInstance() needs to be implemented by subclasses.- 指定者:
clusterInstance
在接口中Clusterer
- 参数:
instance
- the instance to be assigned to a cluster- 返回:
- the number of the assigned cluster as an integer
- 抛出:
Exception
- if instance could not be clustered successfully
-
distributionForInstance
Predicts the cluster memberships for a given instance. Either this or clusterInstance() needs to be implemented by subclasses.- 指定者:
distributionForInstance
在接口中Clusterer
- 参数:
instance
- the instance to be assigned a cluster.- 返回:
- an array containing the estimated membership probabilities of the test instance in each cluster (this should sum to at most 1)
- 抛出:
Exception
- if distribution could not be computed successfully
-
numberOfClusters
Returns the number of clusters.- 指定者:
numberOfClusters
在接口中Clusterer
- 返回:
- the number of clusters generated for a training dataset.
- 抛出:
Exception
- if number of clusters could not be returned successfully
-
forName
Creates a new instance of a clusterer given it's class name and (optional) arguments to pass to it's setOptions method. If the clusterer implements OptionHandler and the options parameter is non-null, the clusterer will have it's options set.- 参数:
clustererName
- the fully qualified class name of the clustereroptions
- an array of options suitable for passing to setOptions. May be null.- 返回:
- the newly created search object, ready for use.
- 抛出:
Exception
- if the clusterer class name is invalid, or the options supplied are not acceptable to the clusterer.
-
makeCopy
Creates a deep copy of the given clusterer using serialization.- 参数:
model
- the clusterer to copy- 返回:
- a deep copy of the clusterer
- 抛出:
Exception
- if an error occurs
-
makeCopies
Creates copies of the current clusterer. Note that this method now uses Serialization to perform a deep copy, so the Clusterer object must be fully Serializable. Any currently built model will now be copied as well.- 参数:
model
- an example clusterer to copynum
- the number of clusterer copies to create.- 返回:
- an array of clusterers.
- 抛出:
Exception
- if an error occurs
-
getCapabilities
Returns the Capabilities of this clusterer. Derived classifiers have to override this method to enable capabilities.- 指定者:
getCapabilities
在接口中CapabilitiesHandler
- 指定者:
getCapabilities
在接口中Clusterer
- 返回:
- the capabilities of this object
- 另请参阅:
-
getRevision
Returns the revision string.- 指定者:
getRevision
在接口中RevisionHandler
- 返回:
- the revision
-