Package weka.classifiers.functions
Class GaussianProcesses
java.lang.Object
weka.classifiers.AbstractClassifier
weka.classifiers.RandomizableClassifier
weka.classifiers.functions.GaussianProcesses
- All Implemented Interfaces:
Serializable,Cloneable,Classifier,ConditionalDensityEstimator,IntervalEstimator,BatchPredictor,CapabilitiesHandler,CapabilitiesIgnorer,CommandlineRunnable,OptionHandler,Randomizable,RevisionHandler,TechnicalInformationHandler,WeightedInstancesHandler
public class GaussianProcesses
extends RandomizableClassifier
implements IntervalEstimator, ConditionalDensityEstimator, TechnicalInformationHandler, WeightedInstancesHandler
* Implements Gaussian processes for regression without hyperparameter-tuning. To make choosing an appropriate noise level easier, this implementation applies normalization/standardization to the target attribute as well as the other attributes (if normalization/standardizaton is turned on). Missing values are replaced by the global mean/mode. Nominal attributes are converted to binary ones. Note that kernel caching is turned off if the kernel used implements CachedKernel.
*
* BibTeX: *
* Valid options are:
* 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:
* *
-L <double> * Level of Gaussian Noise wrt transformed target. (default 1)* *
-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)* *
-S <num> * Random number seed. * (default 1)* *
-output-debug-info * If set, classifier is run in debug mode and * may output additional info to the console* *
-do-not-check-capabilities * If set, classifier capabilities are not checked before classifier is built * (use with caution).* *
-num-decimal-places * The number of decimal places for the output of numbers in the model (default 2).* *
* Options specific to kernel weka.classifiers.functions.supportVector.PolyKernel: ** *
-E <num> * The Exponent to use. * (default: 1.0)* *
-L * Use lower-order terms. * (default: no)* *
-C <num> * The size of the cache (a prime number), 0 for full cache and * -1 to turn it off. * (default: 250007)* *
-output-debug-info * Enables debugging output (if available) to be printed. * (default: off)* *
-no-checks * Turns off all checks - use with caution! * (default: checks on)*
- Version:
- $Revision: 15520 $
- Author:
- Kurt Driessens (kurtd@cs.waikato.ac.nz), Remco Bouckaert (remco@cs.waikato.ac.nz), Eibe Frank, University of Waikato
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intno filterstatic final intnormalizes the datastatic final intstandardizes the datano.uib.cipr.matrix.Matrix(negative) covariance matrix in symmetric matrix representationstatic final Tag[]The filter to apply to the training dataFields inherited from class weka.classifiers.AbstractClassifier
BATCH_SIZE_DEFAULT, NUM_DECIMAL_PLACES_DEFAULT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbuildClassifier(Instances insts) Method for building the classifier.doubleclassifyInstance(Instance inst) Classifies a given instance.Returns the tip text for this propertyReturns default capabilities of the classifier.Gets how the training data will be transformed.Gets the kernel to use.doublegetNoise()Get the value of noise.String[]Gets the current settings of the classifier.doublegetStandardDeviation(Instance inst) Gives standard deviation of the prediction at the given instance.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.Returns a string describing classifierReturns the tip text for this propertyReturns an enumeration describing the available options.doublelogDensity(Instance inst, double value) Returns natural logarithm of density estimate for given value based on given instance.static voidMain method for testing this class.Returns the tip text for this propertydouble[][]predictIntervals(Instance inst, double confidenceLevel) Computes a prediction interval for the given instance and confidence level.voidsetFilterType(SelectedTag newType) Sets how the training data will be transformed.voidSets the kernel to use.voidsetNoise(double v) Set the level of Gaussian Noise.voidsetOptions(String[] options) Parses a given list of options.toString()Prints out the classifier.Methods inherited from class weka.classifiers.RandomizableClassifier
getSeed, seedTipText, setSeedMethods inherited from class weka.classifiers.AbstractClassifier
batchSizeTipText, debugTipText, distributionForInstance, distributionsForInstances, doNotCheckCapabilitiesTipText, forName, getBatchSize, getDebug, getDoNotCheckCapabilities, getNumDecimalPlaces, getRevision, implementsMoreEfficientBatchPrediction, makeCopies, makeCopy, numDecimalPlacesTipText, postExecution, preExecution, run, runClassifier, setBatchSize, setDebug, setDoNotCheckCapabilities, setNumDecimalPlaces
-
Field Details
-
FILTER_NORMALIZE
public static final int FILTER_NORMALIZEnormalizes the data- See Also:
-
FILTER_STANDARDIZE
public static final int FILTER_STANDARDIZEstandardizes the data- See Also:
-
FILTER_NONE
public static final int FILTER_NONEno filter- See Also:
-
TAGS_FILTER
The filter to apply to the training data -
m_L
public no.uib.cipr.matrix.Matrix m_L(negative) covariance matrix in symmetric matrix representation
-
-
Constructor Details
-
GaussianProcesses
public GaussianProcesses()
-
-
Method Details
-
globalInfo
Returns a string describing classifier- Returns:
- a description suitable for displaying in the explorer/experimenter gui
-
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
Returns default capabilities of the classifier.- Specified by:
getCapabilitiesin interfaceCapabilitiesHandler- Specified by:
getCapabilitiesin interfaceClassifier- Overrides:
getCapabilitiesin classAbstractClassifier- Returns:
- the capabilities of this classifier
- See Also:
-
buildClassifier
Method for building the classifier.- Specified by:
buildClassifierin interfaceClassifier- Parameters:
insts- the set of training instances- Throws:
Exception- if the classifier can't be built successfully
-
classifyInstance
Classifies a given instance.- Specified by:
classifyInstancein interfaceClassifier- Overrides:
classifyInstancein classAbstractClassifier- Parameters:
inst- the instance to be classified- Returns:
- the classification
- Throws:
Exception- if instance could not be classified successfully
-
predictIntervals
Computes a prediction interval for the given instance and confidence level.- Specified by:
predictIntervalsin 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:
Exception- if interval could not be estimated successfully
-
getStandardDeviation
Gives standard deviation of the prediction at the given instance.- Parameters:
inst- the instance to get the standard deviation for- Returns:
- the standard deviation
- Throws:
Exception- if computation fails
-
logDensity
Returns natural logarithm of density estimate for given value based on given instance.- Specified by:
logDensityin interfaceConditionalDensityEstimator- Parameters:
inst- the instance to make the prediction for.value- the value to make the prediction for.- Returns:
- the natural logarithm of the density estimate
- Throws:
Exception- if the density cannot be computed
-
listOptions
Returns an enumeration describing the available options.- Specified by:
listOptionsin interfaceOptionHandler- Overrides:
listOptionsin classRandomizableClassifier- Returns:
- an enumeration of all the available options.
-
setOptions
Parses a given list of options. * Valid options are:* *
-L <double> * Level of Gaussian Noise wrt transformed target. (default 1)
* *-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)
* *-S <num> * Random number seed. * (default 1)
* *-output-debug-info * If set, classifier is run in debug mode and * may output additional info to the console
* *-do-not-check-capabilities * If set, classifier capabilities are not checked before classifier is built * (use with caution).
* *-num-decimal-places * The number of decimal places for the output of numbers in the model (default 2).
* ** Options specific to kernel weka.classifiers.functions.supportVector.PolyKernel: *
* *-E <num> * The Exponent to use. * (default: 1.0)
* *-L * Use lower-order terms. * (default: no)
* *-C <num> * The size of the cache (a prime number), 0 for full cache and * -1 to turn it off. * (default: 250007)
* *-output-debug-info * Enables debugging output (if available) to be printed. * (default: off)
* *-no-checks * Turns off all checks - use with caution! * (default: checks on)
*- Specified by:
setOptionsin interfaceOptionHandler- Overrides:
setOptionsin classRandomizableClassifier- Parameters:
options- the list of options as an array of strings- Throws:
Exception- if an option is not supported
-
getOptions
Gets the current settings of the classifier.- Specified by:
getOptionsin interfaceOptionHandler- Overrides:
getOptionsin classRandomizableClassifier- Returns:
- an array of strings suitable for passing to setOptions
-
kernelTipText
Returns the tip text for this property- Returns:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
getKernel
Gets the kernel to use.- Returns:
- the kernel
-
setKernel
Sets the kernel to use.- Parameters:
value- the new kernel
-
filterTypeTipText
Returns the tip text for this property- Returns:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
getFilterType
Gets how the training data will be transformed. Will be one of FILTER_NORMALIZE, FILTER_STANDARDIZE, FILTER_NONE.- Returns:
- the filtering mode
-
setFilterType
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
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
Prints out the classifier. -
main
Main method for testing this class.- Parameters:
argv- the commandline parameters
-