Package weka.classifiers.functions
Class GaussianProcesses
- java.lang.Object
-
- weka.classifiers.Classifier
-
- weka.classifiers.functions.GaussianProcesses
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,IntervalEstimator,CapabilitiesHandler,OptionHandler,RevisionHandler,TechnicalInformationHandler
public class GaussianProcesses extends Classifier implements OptionHandler, IntervalEstimator, TechnicalInformationHandler
Implements Gaussian Processes for regression without hyperparameter-tuning. For more information see
David J.C. Mackay (1998). Introduction to Gaussian Processes. Dept. of Physics, Cambridge University, UK. BibTeX:@misc{Mackay1998, address = {Dept. of Physics, Cambridge University, UK}, author = {David J.C. Mackay}, title = {Introduction to Gaussian Processes}, year = {1998}, PS = {http://wol.ra.phy.cam.ac.uk/mackay/gpB.ps.gz} }Valid options are:-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)
-N Whether to 0=normalize/1=standardize/2=neither. (default: 0=normalize)
-K <classname and parameters> The Kernel to use. (default: weka.classifiers.functions.supportVector.PolyKernel)
Options specific to kernel weka.classifiers.functions.supportVector.RBFKernel:
-D Enables debugging output (if available) to be printed. (default: off)
-no-checks Turns off all checks - use with caution! (default: checks on)
-C <num> The size of the cache (a prime number), 0 for full cache and -1 to turn it off. (default: 250007)
-G <num> The Gamma parameter. (default: 0.01)
- Version:
- $Revision: 1.8 $
- Author:
- Kurt Driessens (kurtd@cs.waikato.ac.nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static intFILTER_NONEno filterstatic intFILTER_NORMALIZEnormalizes the datastatic intFILTER_STANDARDIZEstandardizes the datastatic Tag[]TAGS_FILTERThe filter to apply to the training data
-
Constructor Summary
Constructors Constructor Description GaussianProcesses()the default constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbuildClassifier(Instances insts)Method for building the classifier.doubleclassifyInstance(Instance inst)Classifies a given instance.java.lang.StringfilterTypeTipText()Returns the tip text for this propertyCapabilitiesgetCapabilities()Returns default capabilities of the classifier.SelectedTaggetFilterType()Gets how the training data will be transformed.KernelgetKernel()Gets the kernel to use.doublegetNoise()Get the value of noise.java.lang.String[]getOptions()Gets the current settings of the classifier.java.lang.StringgetRevision()Returns the revision string.doublegetStandardDeviation(Instance inst)Gives the variance of the prediction at the given instanceTechnicalInformationgetTechnicalInformation()Returns an instance of a TechnicalInformation object, containing detailed information about the technical background of this class, e.g., paper reference or book this class is based on.java.lang.StringglobalInfo()Returns a string describing classifierjava.lang.StringkernelTipText()Returns the tip text for this propertyjava.util.EnumerationlistOptions()Returns an enumeration describing the available options.static voidmain(java.lang.String[] argv)Main method for testing this class.java.lang.StringnoiseTipText()Returns the tip text for this propertydouble[][]predictInterval(Instance inst, double confidenceLevel)Predicts a confidence interval for the given instance and confidence level.voidsetFilterType(SelectedTag newType)Sets how the training data will be transformed.voidsetKernel(Kernel value)Sets the kernel to use.voidsetNoise(double v)Set the level of Gaussian Noise.voidsetOptions(java.lang.String[] options)Parses a given list of options.java.lang.StringtoString()Prints out the classifier.-
Methods inherited from class weka.classifiers.Classifier
debugTipText, distributionForInstance, forName, getDebug, makeCopies, makeCopy, setDebug
-
-
-
-
Field Detail
-
FILTER_NORMALIZE
public static final int FILTER_NORMALIZE
normalizes the data- See Also:
- Constant Field Values
-
FILTER_STANDARDIZE
public static final int FILTER_STANDARDIZE
standardizes the data- See Also:
- Constant Field Values
-
FILTER_NONE
public static final int FILTER_NONE
no filter- See Also:
- Constant Field Values
-
TAGS_FILTER
public static final Tag[] TAGS_FILTER
The filter to apply to the training data
-
-
Method Detail
-
globalInfo
public java.lang.String globalInfo()
Returns a string describing classifier- Returns:
- a description suitable for displaying in the explorer/experimenter gui
-
getTechnicalInformation
public TechnicalInformation getTechnicalInformation()
Returns an instance of a TechnicalInformation object, containing detailed information about the technical background of this class, e.g., paper reference or book this class is based on.- Specified by:
getTechnicalInformationin interfaceTechnicalInformationHandler- Returns:
- the technical information about this class
-
getCapabilities
public Capabilities getCapabilities()
Returns default capabilities of the classifier.- Specified by:
getCapabilitiesin interfaceCapabilitiesHandler- Overrides:
getCapabilitiesin classClassifier- Returns:
- the capabilities of this classifier
- See Also:
Capabilities
-
buildClassifier
public void buildClassifier(Instances insts) throws java.lang.Exception
Method for building the classifier.- Specified by:
buildClassifierin classClassifier- Parameters:
insts- the set of training instances- Throws:
java.lang.Exception- if the classifier can't be built successfully
-
classifyInstance
public double classifyInstance(Instance inst) throws java.lang.Exception
Classifies a given instance.- Overrides:
classifyInstancein classClassifier- Parameters:
inst- the instance to be classified- Returns:
- the classification
- Throws:
java.lang.Exception- if instance could not be classified successfully
-
predictInterval
public double[][] predictInterval(Instance inst, double confidenceLevel) throws java.lang.Exception
Predicts a confidence interval for the given instance and confidence level.- Specified by:
predictIntervalin interfaceIntervalEstimator- Parameters:
inst- the instance to make the prediction forconfidenceLevel- the percentage of cases the interval should cover- Returns:
- a 1*2 array that contains the boundaries of the interval
- Throws:
java.lang.Exception- if interval could not be estimated successfully
-
getStandardDeviation
public double getStandardDeviation(Instance inst) throws java.lang.Exception
Gives the variance of the prediction at the given instance- Parameters:
inst- the instance to get the variance for- Returns:
- tha variance
- Throws:
java.lang.Exception- if computation fails
-
listOptions
public java.util.Enumeration listOptions()
Returns an enumeration describing the available options.- Specified by:
listOptionsin interfaceOptionHandler- Overrides:
listOptionsin classClassifier- 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:-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)
-N Whether to 0=normalize/1=standardize/2=neither. (default: 0=normalize)
-K <classname and parameters> The Kernel to use. (default: weka.classifiers.functions.supportVector.PolyKernel)
Options specific to kernel weka.classifiers.functions.supportVector.RBFKernel:
-D Enables debugging output (if available) to be printed. (default: off)
-no-checks Turns off all checks - use with caution! (default: checks on)
-C <num> The size of the cache (a prime number), 0 for full cache and -1 to turn it off. (default: 250007)
-G <num> The Gamma parameter. (default: 0.01)
- Specified by:
setOptionsin interfaceOptionHandler- Overrides:
setOptionsin classClassifier- 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- Overrides:
getOptionsin classClassifier- Returns:
- an array of strings suitable for passing to setOptions
-
kernelTipText
public java.lang.String kernelTipText()
Returns the tip text for this property- Returns:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
getKernel
public Kernel getKernel()
Gets the kernel to use.- Returns:
- the kernel
-
setKernel
public void setKernel(Kernel value)
Sets the kernel to use.- Parameters:
value- the new kernel
-
filterTypeTipText
public java.lang.String filterTypeTipText()
Returns the tip text for this property- Returns:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
getFilterType
public SelectedTag getFilterType()
Gets how the training data will be transformed. Will be one of FILTER_NORMALIZE, FILTER_STANDARDIZE, FILTER_NONE.2200Instances- Returns:
- the filtering mode
-
setFilterType
public void setFilterType(SelectedTag newType)
Sets how the training data will be transformed. Should be one of FILTER_NORMALIZE, FILTER_STANDARDIZE, FILTER_NONE.- Parameters:
newType- the new filtering mode
-
noiseTipText
public java.lang.String noiseTipText()
Returns the tip text for this property- Returns:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
getNoise
public double getNoise()
Get the value of noise.- Returns:
- Value of noise.
-
setNoise
public void setNoise(double v)
Set the level of Gaussian Noise.- Parameters:
v- Value to assign to noise.
-
toString
public java.lang.String toString()
Prints out the classifier.- Overrides:
toStringin classjava.lang.Object- Returns:
- a description of the classifier as a string
-
getRevision
public java.lang.String getRevision()
Returns the revision string.- Specified by:
getRevisionin interfaceRevisionHandler- Overrides:
getRevisionin classClassifier- Returns:
- the revision
-
main
public static void main(java.lang.String[] argv)
Main method for testing this class.- Parameters:
argv- the commandline parameters
-
-