weka.classifiers.meta
Class AbstainAttributePercentile

java.lang.Object
  extended by weka.classifiers.AbstractClassifier
      extended by weka.classifiers.SingleClassifierEnhancer
          extended by weka.classifiers.meta.AbstainAttributePercentile
All Implemented Interfaces:
Serializable, Cloneable, weka.classifiers.Classifier, weka.core.CapabilitiesHandler, weka.core.OptionHandler, weka.core.RevisionHandler, weka.core.WeightedInstancesHandler

public class AbstainAttributePercentile
extends weka.classifiers.SingleClassifierEnhancer
implements weka.core.WeightedInstancesHandler

Only predict if attribute value within percentile range. Ensure same for training set if req.

Version:
$Revision: 5710 $
Author:
Dale
See Also:
Serialized Form

Field Summary
protected  int m_attnum
           
protected  weka.core.Instances m_Data
           
protected  boolean m_debug
           
protected  double m_max
           
protected  double m_min
           
protected  boolean m_ok
           
protected  double m_pctile
           
protected  Range m_Range
           
protected  Hashtable<Integer,double[]> m_Ranges
          the ranges (attribute index <-> double[]).
protected  boolean m_removetrain
           
 
Fields inherited from class weka.classifiers.SingleClassifierEnhancer
m_Classifier
 
Fields inherited from class weka.classifiers.AbstractClassifier
m_Debug
 
Constructor Summary
AbstainAttributePercentile()
           
 
Method Summary
 String attributeTipText()
           
 void buildClassifier(weka.core.Instances data)
          Builds the classifier.
 double classifyInstance(weka.core.Instance inst)
          Returns the prediction.
 String getAttribute()
           
 weka.core.Capabilities getCapabilities()
          Returns default capabilities of the base classifier.
 String[] getOptions()
          Gets the current option settings for the OptionHandler.
 double getPercentile()
           
 boolean getRemoveTrain()
           
 String getRevision()
           
 String globalInfo()
          Returns a string describing classifier.
 Enumeration listOptions()
          Returns an enumeration describing the available options.
static void main(String[] argv)
          Main method for running this class.
 String percentileTipText()
           
 String removeTrainTipText()
           
 void setAttribute(String at)
           
 void setOptions(String[] options)
          Sets the OptionHandler's options using the given list.
 void setPercentile(double var)
           
 void setRemoveTrain(boolean t)
           
 String toString()
          Returns description of classifier.
 
Methods inherited from class weka.classifiers.SingleClassifierEnhancer
classifierTipText, defaultClassifierString, getClassifier, getClassifierSpec, setClassifier
 
Methods inherited from class weka.classifiers.AbstractClassifier
debugTipText, distributionForInstance, forName, getDebug, makeCopies, makeCopy, runClassifier, setDebug
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_Data

protected weka.core.Instances m_Data

m_attnum

protected int m_attnum

m_debug

protected boolean m_debug

m_pctile

protected double m_pctile

m_ok

protected boolean m_ok

m_removetrain

protected boolean m_removetrain

m_min

protected double m_min

m_max

protected double m_max

m_Ranges

protected Hashtable<Integer,double[]> m_Ranges
the ranges (attribute index <-> double[]).


m_Range

protected Range m_Range
Constructor Detail

AbstainAttributePercentile

public AbstainAttributePercentile()
Method Detail

globalInfo

public String globalInfo()
Returns a string describing classifier.

Returns:
a description suitable for displaying in the explorer/experimenter gui

listOptions

public Enumeration listOptions()
Returns an enumeration describing the available options.

Specified by:
listOptions in interface weka.core.OptionHandler
Overrides:
listOptions in class weka.classifiers.SingleClassifierEnhancer
Returns:
an enumeration of all the available options.

setOptions

public void setOptions(String[] options)
                throws Exception
Sets the OptionHandler's options using the given list. All options will be set (or reset) during this call (i.e. incremental setting of options is not possible). 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.rules.ZeroR)
 Options specific to classifier weka.classifiers.rules.ZeroR:
 
 -D
  If set, classifier is run in debug mode and
  may output additional info to the console
 -S <sint>
  Number of regressions
  (default: 10)
 
 -P <int>
  Percent sample size
  (default: 60)
 
 -E <int>
  Percent Error at
  (default: 50)
 
 -G <seed>
  Set the seed used to generate samples
  (default: 0)
 

Specified by:
setOptions in interface weka.core.OptionHandler
Overrides:
setOptions in class weka.classifiers.SingleClassifierEnhancer
Parameters:
options - the list of options as an array of strings
Throws:
Exception - if an option is not supported

getOptions

public String[] getOptions()
Gets the current option settings for the OptionHandler.

Specified by:
getOptions in interface weka.core.OptionHandler
Overrides:
getOptions in class weka.classifiers.SingleClassifierEnhancer
Returns:
the list of current option settings as an array of strings

getCapabilities

public weka.core.Capabilities getCapabilities()
Returns default capabilities of the base classifier.

Specified by:
getCapabilities in interface weka.classifiers.Classifier
Specified by:
getCapabilities in interface weka.core.CapabilitiesHandler
Overrides:
getCapabilities in class weka.classifiers.SingleClassifierEnhancer
Returns:
the capabilities of the base classifier

buildClassifier

public void buildClassifier(weka.core.Instances data)
                     throws Exception
Builds the classifier.

Specified by:
buildClassifier in interface weka.classifiers.Classifier
Parameters:
data - the training data
Throws:
Exception - if something goes wrong

classifyInstance

public double classifyInstance(weka.core.Instance inst)
                        throws Exception
Returns the prediction.

Specified by:
classifyInstance in interface weka.classifiers.Classifier
Overrides:
classifyInstance in class weka.classifiers.AbstractClassifier
Throws:
Exception

toString

public String toString()
Returns description of classifier.

Overrides:
toString in class Object

getRevision

public String getRevision()
Specified by:
getRevision in interface weka.core.RevisionHandler
Overrides:
getRevision in class weka.classifiers.AbstractClassifier

setPercentile

public void setPercentile(double var)

getPercentile

public double getPercentile()

percentileTipText

public String percentileTipText()

setAttribute

public void setAttribute(String at)

getAttribute

public String getAttribute()

attributeTipText

public String attributeTipText()

setRemoveTrain

public void setRemoveTrain(boolean t)

getRemoveTrain

public boolean getRemoveTrain()

removeTrainTipText

public String removeTrainTipText()

main

public static void main(String[] argv)
Main method for running this class.

Parameters:
argv - the options


Copyright © 2012 University of Waikato, Hamilton, NZ. All Rights Reserved.