Package weka.classifiers.lazy
Class AbstainingLWL
- java.lang.Object
-
- weka.classifiers.AbstractClassifier
-
- weka.classifiers.SingleClassifierEnhancer
-
- weka.classifiers.lazy.LWL
-
- weka.classifiers.lazy.LWLSynchro
-
- weka.classifiers.lazy.AbstainingLWL
-
- All Implemented Interfaces:
adams.core.Stoppable,adams.core.StoppableWithFeedback,Serializable,Cloneable,AbstainingClassifier,weka.classifiers.Classifier,ThreadSafeClassifier,weka.classifiers.UpdateableClassifier,weka.core.BatchPredictor,weka.core.CapabilitiesHandler,weka.core.CapabilitiesIgnorer,weka.core.CommandlineRunnable,weka.core.OptionHandler,weka.core.RevisionHandler,weka.core.TechnicalInformationHandler,weka.core.WeightedInstancesHandler
public class AbstainingLWL extends LWLSynchro implements AbstainingClassifier
LWL variant that supports abstaining if the base classifier is able to.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanm_CanAbstainwhether the base classifier can abstain.-
Fields inherited from class weka.classifiers.lazy.LWLSynchro
m_NoUpdate, m_Stopped
-
-
Constructor Summary
Constructors Constructor Description AbstainingLWL()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbuildClassifier(weka.core.Instances instances)Generates the classifier.booleancanAbstain()Whether abstaining is possible, e.g., used in meta-classifiers.doublegetAbstentionClassification(weka.core.Instance inst)The prediction that made the classifier abstain.double[]getAbstentionDistribution(weka.core.Instance inst)The class distribution that made the classifier abstain.StringglobalInfo()Returns a string describing classifier.StringtoString()Returns a description of this classifier.-
Methods inherited from class weka.classifiers.lazy.LWLSynchro
build, defaultClassifierString, distributionForInstance, getNoUpdate, getOptions, getRevision, isStopped, listOptions, main, noUpdateTipText, setNoUpdate, setOptions, stopExecution
-
Methods inherited from class weka.classifiers.lazy.LWL
enumerateMeasures, getCapabilities, getKNN, getMeasure, getNearestNeighbourSearchAlgorithm, getTechnicalInformation, getWeightingKernel, KNNTipText, nearestNeighbourSearchAlgorithmTipText, setKNN, setNearestNeighbourSearchAlgorithm, setWeightingKernel, updateClassifier, weightingKernelTipText
-
Methods inherited from class weka.classifiers.SingleClassifierEnhancer
classifierTipText, defaultClassifierOptions, getClassifier, getClassifierSpec, postExecution, preExecution, setClassifier
-
Methods inherited from class weka.classifiers.AbstractClassifier
batchSizeTipText, classifyInstance, debugTipText, distributionsForInstances, doNotCheckCapabilitiesTipText, forName, getBatchSize, getDebug, getDoNotCheckCapabilities, getNumDecimalPlaces, implementsMoreEfficientBatchPrediction, makeCopies, makeCopy, numDecimalPlacesTipText, run, runClassifier, setBatchSize, setDebug, setDoNotCheckCapabilities, setNumDecimalPlaces
-
-
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing classifier.- Overrides:
globalInfoin classweka.classifiers.lazy.LWL- Returns:
- a description suitable for displaying in the explorer/experimenter gui
-
buildClassifier
public void buildClassifier(weka.core.Instances instances) throws ExceptionGenerates the classifier.- Specified by:
buildClassifierin interfaceweka.classifiers.Classifier- Overrides:
buildClassifierin classLWLSynchro- Parameters:
instances- set of instances serving as training data- Throws:
Exception- if the classifier has not been generated successfully
-
canAbstain
public boolean canAbstain()
Whether abstaining is possible, e.g., used in meta-classifiers.- Specified by:
canAbstainin interfaceAbstainingClassifier- Returns:
- true if abstaining is possible
-
getAbstentionClassification
public double getAbstentionClassification(weka.core.Instance inst) throws ExceptionThe prediction that made the classifier abstain.- Specified by:
getAbstentionClassificationin interfaceAbstainingClassifier- Parameters:
inst- the instance to get the prediction for- Returns:
- the prediction,
Utils.missingValue()if abstaining is not possible - Throws:
Exception- if fails to make prediction
-
getAbstentionDistribution
public double[] getAbstentionDistribution(weka.core.Instance inst) throws ExceptionThe class distribution that made the classifier abstain.- Specified by:
getAbstentionDistributionin interfaceAbstainingClassifier- Parameters:
inst- the instance to get the prediction for- Returns:
- the class distribution, null if abstaining is not possible
- Throws:
Exception- if fails to make prediction
-
toString
public String toString()
Returns a description of this classifier.- Overrides:
toStringin classLWLSynchro- Returns:
- a description of this classifier as a string.
-
-