程序包 weka.clusterers
类 MakeDensityBasedClusterer
java.lang.Object
weka.clusterers.AbstractClusterer
weka.clusterers.AbstractDensityBasedClusterer
weka.clusterers.MakeDensityBasedClusterer
- 所有已实现的接口:
Serializable
,Cloneable
,Clusterer
,DensityBasedClusterer
,NumberOfClustersRequestable
,CapabilitiesHandler
,OptionHandler
,RevisionHandler
,WeightedInstancesHandler
public class MakeDensityBasedClusterer
extends AbstractDensityBasedClusterer
implements NumberOfClustersRequestable, OptionHandler, WeightedInstancesHandler
Class for wrapping a Clusterer to make it return a distribution and density. Fits normal distributions and discrete distributions within each cluster produced by the wrapped clusterer. Supports the NumberOfClustersRequestable interface only if the wrapped Clusterer does.
Valid options are:
-M <num> minimum allowable standard deviation for normal density computation (default 1e-6)
-W <clusterer name> Clusterer to wrap. (default weka.clusterers.SimpleKMeans)
Options specific to clusterer weka.clusterers.SimpleKMeans:
-N <num> number of clusters. (default 2).
-V Display std. deviations for centroids.
-M Replace missing values with mean/mode.
-S <num> Random number seed. (default 10)Options after "--" are passed on to the base clusterer.
- 版本:
- $Revision: 5538 $
- 作者:
- Richard Kirkby (rkirkby@cs.waikato.ac.nz), Mark Hall (mhall@cs.waikato.ac.nz), Eibe Frank (eibe@cs.waikato.ac.nz)
- 另请参阅:
-
构造器概要
构造器构造器说明Default constructor.MakeDensityBasedClusterer
(Clusterer toWrap) Contructs a MakeDensityBasedClusterer wrapping a given Clusterer. -
方法概要
修饰符和类型方法说明void
buildClusterer
(Instances data) Builds a clusterer for a set of instances.Returns the tip text for this propertydouble[]
Returns the cluster priors.Returns default capabilities of the clusterer (i.e., of the wrapper clusterer).Gets the clusterer being wrapped.double
Get the minimum allowable standard deviation.String[]
Gets the current settings of the clusterer.Returns the revision string.Returns a string describing classifierReturns an enumeration describing the available options..double[]
Computes the log of the conditional density (per cluster) for a given instance.static void
Main method for testing this class.Returns the tip text for this propertyint
Returns the number of clusters.void
setClusterer
(Clusterer toWrap) Sets the clusterer to wrap.void
setMinStdDev
(double m) Set the minimum value for standard deviation when calculating normal density.void
setNumClusters
(int n) Set the number of clusters to generate.void
setOptions
(String[] options) Parses a given list of options.toString()
Returns a description of the clusterer.从类继承的方法 weka.clusterers.AbstractDensityBasedClusterer
distributionForInstance, logDensityForInstance, logJointDensitiesForInstance, makeCopies
从类继承的方法 weka.clusterers.AbstractClusterer
clusterInstance, forName, makeCopies, makeCopy
从接口继承的方法 weka.clusterers.Clusterer
clusterInstance
-
构造器详细资料
-
MakeDensityBasedClusterer
public MakeDensityBasedClusterer()Default constructor. -
MakeDensityBasedClusterer
Contructs a MakeDensityBasedClusterer wrapping a given Clusterer.- 参数:
toWrap
- the clusterer to wrap around
-
-
方法详细资料
-
globalInfo
Returns a string describing classifier- 返回:
- a description suitable for displaying in the explorer/experimenter gui
-
setNumClusters
Set the number of clusters to generate.- 指定者:
setNumClusters
在接口中NumberOfClustersRequestable
- 参数:
n
- the number of clusters to generate- 抛出:
Exception
- if the wrapped clusterer has not been set, or if the wrapped clusterer does not implement this facility.
-
getCapabilities
Returns default capabilities of the clusterer (i.e., of the wrapper clusterer).- 指定者:
getCapabilities
在接口中CapabilitiesHandler
- 指定者:
getCapabilities
在接口中Clusterer
- 覆盖:
getCapabilities
在类中AbstractClusterer
- 返回:
- the capabilities of this clusterer
- 另请参阅:
-
buildClusterer
Builds a clusterer for a set of instances.- 指定者:
buildClusterer
在接口中Clusterer
- 指定者:
buildClusterer
在类中AbstractClusterer
- 参数:
data
- the instances to train the clusterer with- 抛出:
Exception
- if the clusterer hasn't been set or something goes wrong
-
clusterPriors
public double[] clusterPriors()Returns the cluster priors.- 指定者:
clusterPriors
在接口中DensityBasedClusterer
- 指定者:
clusterPriors
在类中AbstractDensityBasedClusterer
- 返回:
- the cluster priors
-
logDensityPerClusterForInstance
Computes the log of the conditional density (per cluster) for a given instance.- 指定者:
logDensityPerClusterForInstance
在接口中DensityBasedClusterer
- 指定者:
logDensityPerClusterForInstance
在类中AbstractDensityBasedClusterer
- 参数:
inst
- the instance to compute the density for- 返回:
- an array containing the estimated densities
- 抛出:
Exception
- if the density could not be computed successfully
-
numberOfClusters
Returns the number of clusters.- 指定者:
numberOfClusters
在接口中Clusterer
- 指定者:
numberOfClusters
在类中AbstractClusterer
- 返回:
- the number of clusters generated for a training dataset.
- 抛出:
Exception
- if number of clusters could not be returned successfully
-
toString
Returns a description of the clusterer. -
clustererTipText
Returns the tip text for this property- 返回:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setClusterer
Sets the clusterer to wrap.- 参数:
toWrap
- the clusterer
-
getClusterer
Gets the clusterer being wrapped.- 返回:
- the clusterer
-
minStdDevTipText
Returns the tip text for this property- 返回:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setMinStdDev
public void setMinStdDev(double m) Set the minimum value for standard deviation when calculating normal density. Reducing this value can help prevent arithmetic overflow resulting from multiplying large densities (arising from small standard deviations) when there are many singleton or near singleton values.- 参数:
m
- minimum value for standard deviation
-
getMinStdDev
public double getMinStdDev()Get the minimum allowable standard deviation.- 返回:
- the minumum allowable standard deviation
-
listOptions
Returns an enumeration describing the available options..- 指定者:
listOptions
在接口中OptionHandler
- 返回:
- an enumeration of all the available options.
-
setOptions
Parses a given list of options. Valid options are:-M <num> minimum allowable standard deviation for normal density computation (default 1e-6)
-W <clusterer name> Clusterer to wrap. (default weka.clusterers.SimpleKMeans)
Options specific to clusterer weka.clusterers.SimpleKMeans:
-N <num> number of clusters. (default 2).
-V Display std. deviations for centroids.
-M Replace missing values with mean/mode.
-S <num> Random number seed. (default 10)
- 指定者:
setOptions
在接口中OptionHandler
- 参数:
options
- the list of options as an array of strings- 抛出:
Exception
- if an option is not supported
-
getOptions
Gets the current settings of the clusterer.- 指定者:
getOptions
在接口中OptionHandler
- 返回:
- an array of strings suitable for passing to setOptions()
-
getRevision
Returns the revision string.- 指定者:
getRevision
在接口中RevisionHandler
- 覆盖:
getRevision
在类中AbstractClusterer
- 返回:
- the revision
-
main
Main method for testing this class.- 参数:
argv
- the options
-