Package weka.clusterers
Class SpectrumClusterer
- java.lang.Object
-
- weka.clusterers.AbstractClusterer
-
- weka.clusterers.SingleClustererEnhancer
-
- weka.clusterers.SpectrumClusterer
-
- All Implemented Interfaces:
Serializable,Cloneable,weka.clusterers.Clusterer,weka.clusterers.DensityBasedClusterer,weka.core.CapabilitiesHandler,weka.core.CapabilitiesIgnorer,weka.core.CommandlineRunnable,weka.core.OptionHandler,weka.core.RevisionHandler
public class SpectrumClusterer extends weka.clusterers.SingleClustererEnhancer implements weka.clusterers.DensityBasedClustererAutomatically removes some IDs from the dataset before training the base classifier: id, db_id, sample_id.
Valid options are:
-D If set, classifier is run in debug mode and may output additional info to the console
-W Full name of base classifier. (default: weka.classifiers.functions.GPD)
Options specific to classifier weka.classifiers.functions.GPD:
-D If set, classifier is run in debug mode and may output additional info to the console
-L <double> Level of Gaussian Noise. (default: 1.0)
-G <double> Gamma for the RBF kernel. (default: 0.01)
-N Whether to 0=normalize/1=standardize/2=neither. (default: 0=normalize)
-D If set, classifier is run in debug mode and may output additional info to the console
- Version:
- $Revision: 2242 $
- Author:
- Len Trigg ([email protected])
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected weka.clusterers.DensityBasedClustererm_ActualClustererThe actual clusterer.protected weka.filters.unsupervised.attribute.Removem_RemoveThe filter for removing sample ID/database ID.
-
Constructor Summary
Constructors Constructor Description SpectrumClusterer()Default constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbuildClusterer(weka.core.Instances data)Build the clusterer on the filtered data.double[]clusterPriors()Returns the prior probability of each cluster.double[]distributionForInstance(weka.core.Instance instance)Clusters a given instance after filtering.protected weka.core.Instancefilter(weka.core.Instance instance)Filters the instance if the Remove filter has been set up, otherwise it just returns the instance as it is.weka.core.CapabilitiesgetCapabilities()Returns default capabilities of the clusterer.StringgetRevision()Returns the revision string.StringglobalInfo()Returns a string describing this clusterer.doublelogDensityForInstance(weka.core.Instance instance)Computes the density for a given instance.double[]logDensityPerClusterForInstance(weka.core.Instance instance)Computes the log of the conditional density (per cluster) for a given instance.double[]logJointDensitiesForInstance(weka.core.Instance inst)Returns the logs of the joint densities for a given instance.static voidmain(String[] args)Main method for executing this clusterer.StringtoString()Output a representation of this clusterer-
Methods inherited from class weka.clusterers.SingleClustererEnhancer
clustererTipText, defaultClustererString, getClusterer, getClustererSpec, getOptions, listOptions, numberOfClusters, setClusterer, setOptions
-
Methods inherited from class weka.clusterers.AbstractClusterer
clusterInstance, debugTipText, doNotCheckCapabilitiesTipText, forName, getDebug, getDoNotCheckCapabilities, makeCopies, makeCopy, postExecution, preExecution, run, runClusterer, setDebug, setDoNotCheckCapabilities
-
-
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing this clusterer.- Returns:
- a description of the clusterer suitable for displaying in the explorer/experimenter gui
-
getCapabilities
public weka.core.Capabilities getCapabilities()
Returns default capabilities of the clusterer.- Specified by:
getCapabilitiesin interfaceweka.core.CapabilitiesHandler- Specified by:
getCapabilitiesin interfaceweka.clusterers.Clusterer- Overrides:
getCapabilitiesin classweka.clusterers.SingleClustererEnhancer- Returns:
- the capabilities of this clusterer
-
buildClusterer
public void buildClusterer(weka.core.Instances data) throws ExceptionBuild the clusterer on the filtered data.- Specified by:
buildClustererin interfaceweka.clusterers.Clusterer- Specified by:
buildClustererin classweka.clusterers.AbstractClusterer- Parameters:
data- the training data- Throws:
Exception- if the clusterer could not be built successfully
-
filter
protected weka.core.Instance filter(weka.core.Instance instance) throws ExceptionFilters the instance if the Remove filter has been set up, otherwise it just returns the instance as it is.- Parameters:
instance- the instance to filter, if required- Returns:
- the filtered instance
- Throws:
Exception- if filtering fails
-
distributionForInstance
public double[] distributionForInstance(weka.core.Instance instance) throws ExceptionClusters a given instance after filtering.- Specified by:
distributionForInstancein interfaceweka.clusterers.Clusterer- Specified by:
distributionForInstancein interfaceweka.clusterers.DensityBasedClusterer- Overrides:
distributionForInstancein classweka.clusterers.AbstractClusterer- Parameters:
instance- the instance to be clustered- Returns:
- the cluster distribution for the given instance
- Throws:
Exception- if instance could not be clustered successfully
-
clusterPriors
public double[] clusterPriors() throws ExceptionReturns the prior probability of each cluster.- Specified by:
clusterPriorsin interfaceweka.clusterers.DensityBasedClusterer- Returns:
- the prior probability for each cluster
- Throws:
Exception- if priors could not be returned successfully
-
logDensityPerClusterForInstance
public double[] logDensityPerClusterForInstance(weka.core.Instance instance) throws ExceptionComputes the log of the conditional density (per cluster) for a given instance.- Specified by:
logDensityPerClusterForInstancein interfaceweka.clusterers.DensityBasedClusterer- Parameters:
instance- the instance to compute the density for- Returns:
- an array containing the estimated densities
- Throws:
Exception- if the density could not be computed successfully
-
logDensityForInstance
public double logDensityForInstance(weka.core.Instance instance) throws ExceptionComputes the density for a given instance.- Specified by:
logDensityForInstancein interfaceweka.clusterers.DensityBasedClusterer- Parameters:
instance- the instance to compute the density for- Returns:
- the density.
- Throws:
Exception- if the density could not be computed successfully
-
logJointDensitiesForInstance
public double[] logJointDensitiesForInstance(weka.core.Instance inst) throws ExceptionReturns the logs of the joint densities for a given instance.- Specified by:
logJointDensitiesForInstancein interfaceweka.clusterers.DensityBasedClusterer- Parameters:
inst- the instance- Returns:
- the array of values
- Throws:
Exception- if values could not be computed
-
toString
public String toString()
Output a representation of this clusterer
-
getRevision
public String getRevision()
Returns the revision string.- Specified by:
getRevisionin interfaceweka.core.RevisionHandler- Overrides:
getRevisionin classweka.clusterers.AbstractClusterer- Returns:
- the revision
-
main
public static void main(String[] args)
Main method for executing this clusterer.- Parameters:
args- the commandline options, use -h for help
-
-