Package weka.experiment
Class DensityBasedClustererSplitEvaluator
- java.lang.Object
-
- weka.experiment.DensityBasedClustererSplitEvaluator
-
- All Implemented Interfaces:
java.io.Serializable,AdditionalMeasureProducer,OptionHandler,RevisionHandler,SplitEvaluator
public class DensityBasedClustererSplitEvaluator extends java.lang.Object implements SplitEvaluator, OptionHandler, AdditionalMeasureProducer, RevisionHandler
A SplitEvaluator that produces results for a density based clusterer. -W classname
Specify the full class name of the clusterer to evaluate.- Version:
- $Revision: 11198 $
- Author:
- Mark Hall (mhall{[at]}pentaho{[dot]}org
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DensityBasedClustererSplitEvaluator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringclustererTipText()Returns the tip text for this propertyjava.util.EnumerationenumerateMeasures()Returns an enumeration of any additional measure names that might be in the classifierDensityBasedClusterergetClusterer()Get the value of clustererjava.lang.Object[]getKey()Gets the key describing the current SplitEvaluator.java.lang.String[]getKeyNames()Gets the names of each of the key columns produced for a single run.java.lang.Object[]getKeyTypes()Gets the data types of each of the key columns produced for a single run.doublegetMeasure(java.lang.String additionalMeasureName)Returns the value of the named measurejava.lang.String[]getOptions()Gets the current settings of the Classifier.java.lang.StringgetRawResultOutput()Gets the raw output from the classifierbooleangetRemoveClassColumn()Get whether the class column is to be removed.java.lang.Object[]getResult(Instances train, Instances test)Gets the results for the supplied train and test datasets.java.lang.String[]getResultNames()Gets the names of each of the result columns produced for a single run.java.lang.Object[]getResultTypes()Gets the data types of each of the result columns produced for a single run.java.lang.StringgetRevision()Returns the revision string.java.lang.StringglobalInfo()Returns a string describing this split evaluatorjava.util.EnumerationlistOptions()Returns an enumeration describing the available options.java.lang.StringremoveClassColumnTipText()Returns the tip text for this propertyvoidsetAdditionalMeasures(java.lang.String[] additionalMeasures)Set a list of method names for additional measures to look for in Classifiers.voidsetClusterer(DensityBasedClusterer newClusterer)Sets the clusterer.voidsetClustererName(java.lang.String newClustererName)Set the Clusterer to use, given it's class name.voidsetOptions(java.lang.String[] options)Parses a given list of options.voidsetRemoveClassColumn(boolean r)Set whether the class column should be removed from the data.java.lang.StringtoString()Returns a text description of the split evaluator.
-
-
-
Method Detail
-
globalInfo
public java.lang.String globalInfo()
Returns a string describing this split evaluator- Returns:
- a description of the split evaluator suitable for displaying in the explorer/experimenter gui
-
listOptions
public java.util.Enumeration listOptions()
Returns an enumeration describing the available options.- Specified by:
listOptionsin interfaceOptionHandler- Returns:
- an enumeration of all the available options.
-
setOptions
public void setOptions(java.lang.String[] options) throws java.lang.ExceptionParses a given list of options. Valid options are:-W classname
Specify the full class name of the clusterer to evaluate.All option after -- will be passed to the classifier.
- Specified by:
setOptionsin interfaceOptionHandler- Parameters:
options- the list of options as an array of strings- Throws:
java.lang.Exception- if an option is not supported
-
getOptions
public java.lang.String[] getOptions()
Gets the current settings of the Classifier.- Specified by:
getOptionsin interfaceOptionHandler- Returns:
- an array of strings suitable for passing to setOptions
-
setAdditionalMeasures
public void setAdditionalMeasures(java.lang.String[] additionalMeasures)
Set a list of method names for additional measures to look for in Classifiers. This could contain many measures (of which only a subset may be produceable by the current Classifier) if an experiment is the type that iterates over a set of properties.- Specified by:
setAdditionalMeasuresin interfaceSplitEvaluator- Parameters:
additionalMeasures- a list of method names
-
enumerateMeasures
public java.util.Enumeration enumerateMeasures()
Returns an enumeration of any additional measure names that might be in the classifier- Specified by:
enumerateMeasuresin interfaceAdditionalMeasureProducer- Returns:
- an enumeration of the measure names
-
getMeasure
public double getMeasure(java.lang.String additionalMeasureName)
Returns the value of the named measure- Specified by:
getMeasurein interfaceAdditionalMeasureProducer- Parameters:
measureName- the name of the measure to query for its value- Returns:
- the value of the named measure
- Throws:
java.lang.IllegalArgumentException- if the named measure is not supported
-
getKeyTypes
public java.lang.Object[] getKeyTypes()
Gets the data types of each of the key columns produced for a single run. The number of key fields must be constant for a given SplitEvaluator.- Specified by:
getKeyTypesin interfaceSplitEvaluator- Returns:
- an array containing objects of the type of each key column. The objects should be Strings, or Doubles.
-
getKeyNames
public java.lang.String[] getKeyNames()
Gets the names of each of the key columns produced for a single run. The number of key fields must be constant for a given SplitEvaluator.- Specified by:
getKeyNamesin interfaceSplitEvaluator- Returns:
- an array containing the name of each key column
-
getKey
public java.lang.Object[] getKey()
Gets the key describing the current SplitEvaluator. For example This may contain the name of the classifier used for classifier predictive evaluation. The number of key fields must be constant for a given SplitEvaluator.- Specified by:
getKeyin interfaceSplitEvaluator- Returns:
- an array of objects containing the key.
-
getResultTypes
public java.lang.Object[] getResultTypes()
Gets the data types of each of the result columns produced for a single run. The number of result fields must be constant for a given SplitEvaluator.- Specified by:
getResultTypesin interfaceSplitEvaluator- Returns:
- an array containing objects of the type of each result column. The objects should be Strings, or Doubles.
-
getResultNames
public java.lang.String[] getResultNames()
Gets the names of each of the result columns produced for a single run. The number of result fields must be constant for a given SplitEvaluator.- Specified by:
getResultNamesin interfaceSplitEvaluator- Returns:
- an array containing the name of each result column
-
getResult
public java.lang.Object[] getResult(Instances train, Instances test) throws java.lang.Exception
Gets the results for the supplied train and test datasets.- Specified by:
getResultin interfaceSplitEvaluator- Parameters:
train- the training Instances.test- the testing Instances.- Returns:
- the results stored in an array. The objects stored in the array may be Strings, Doubles, or null (for the missing value).
- Throws:
java.lang.Exception- if a problem occurs while getting the results
-
removeClassColumnTipText
public java.lang.String removeClassColumnTipText()
Returns the tip text for this property- Returns:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setRemoveClassColumn
public void setRemoveClassColumn(boolean r)
Set whether the class column should be removed from the data.- Parameters:
r- true if the class column is to be removed.
-
getRemoveClassColumn
public boolean getRemoveClassColumn()
Get whether the class column is to be removed.- Returns:
- true if the class column is to be removed.
-
clustererTipText
public java.lang.String clustererTipText()
Returns the tip text for this property- Returns:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
getClusterer
public DensityBasedClusterer getClusterer()
Get the value of clusterer- Returns:
- Value of clusterer.
-
setClusterer
public void setClusterer(DensityBasedClusterer newClusterer)
Sets the clusterer.- Parameters:
newClassifier- the new clusterer to use.
-
setClustererName
public void setClustererName(java.lang.String newClustererName) throws java.lang.ExceptionSet the Clusterer to use, given it's class name. A new clusterer will be instantiated.- Parameters:
newClusterer- the Classifier class name.- Throws:
java.lang.Exception- if the class name is invalid.
-
getRawResultOutput
public java.lang.String getRawResultOutput()
Gets the raw output from the classifier- Specified by:
getRawResultOutputin interfaceSplitEvaluator- Returns:
- the raw output from the classifier
-
toString
public java.lang.String toString()
Returns a text description of the split evaluator.- Overrides:
toStringin classjava.lang.Object- Returns:
- a text description of the split evaluator.
-
getRevision
public java.lang.String getRevision()
Returns the revision string.- Specified by:
getRevisionin interfaceRevisionHandler- Returns:
- the revision
-
-