Package mvpa :: Package clfs :: Module gpr :: Class GPR

[hide private]
[frames] | no frames]

# Class GPR

source code

Gaussian Process Regression (GPR).

Nested Classes | [hide private]

Inherited from `misc.state.ClassWithCollections`: `__metaclass__`

Instance Methods | [hide private]

__init__(self, kernel=None, **kwargs) Initialize a GPR regression analysis. | source code

_init_internals(self) Reset some internal variables to None. | source code

__repr__(self) String summary of the object | source code

compute_log_marginal_likelihood(self) Compute log marginal likelihood using self.train_fv and self.labels. | source code

compute_gradient_log_marginal_likelihood(self) Compute gradient of the log marginal likelihood. This version use a more compact formula provided by Williams and Rasmussen book. | source code

compute_gradient_log_marginal_likelihood_logscale(self) Compute gradient of the log marginal likelihood when hyperparameters are in logscale. This version use a more compact formula provided by Williams and Rasmussen book. | source code

getSensitivityAnalyzer(self, flavor='auto', **kwargs) Returns a sensitivity analyzer for GPR. | source code

_train(self, data) Train the classifier using `data` (Dataset). | source code

_predict(self, data) Predict the output for the provided data. | source code

_setRetrainable(self, value, force=False) Internal function : need to set _km_test_test | source code

untrain(self) Reset trained state | source code

set_hyperparameters(self, hyperparameter) Set hyperparameters' values. | source code

Inherited from `base.Classifier`: `__str__`, `clone`, `isTrained`, `predict`, `repredict`, `retrain`, `summary`, `train`, `trained`

Inherited from `base.Classifier` (private): `_getFeatureIds`, `_postpredict`, `_posttrain`, `_prepredict`, `_pretrain`, `_regressionIsBogus`

Inherited from `misc.state.ClassWithCollections`: `__getattribute__`, `__new__`, `__setattr__`, `reset`

Inherited from `object`: `__delattr__`, `__format__`, `__hash__`, `__reduce__`, `__reduce_ex__`, `__sizeof__`, `__subclasshook__`

Class Variables | [hide private]

| predicted_variances = `StateVariable(enabled= False, doc= "Vari`...``
| log_marginal_likelihood = `StateVariable(enabled= False, doc= "`...``
| log_marginal_likelihood_gradient = `StateVariable(enabled= Fals`...``
| _clf_internals = `['gpr', 'regression', 'retrainable']` Describes some specifics about the classifier -- is that it is doing regression for instance....
| sigma_noise = `Parameter(0.001, allowedtype= 'float', min= 1e-1`...``
| lm = `Parameter(0.0, min= 0.0, allowedtype= 'float', doc= """Th`...``
| kernel = `property(fget= lambda self: self.__kernel)`
Inherited from `base.Classifier`: `_DEV__doc__`, `feature_ids`, `predicting_time`, `predictions`, `regression`, `retrainable`, `trained_dataset`, `trained_labels`, `trained_nsamples`, `training_confusion`, `training_time`, `values` Inherited from `misc.state.ClassWithCollections`: `descr`

Properties | [hide private]

Inherited from `object`: `__class__`

Method Details | [hide private]

### __init__(self, kernel=None, **kwargs)
(Constructor)

source code

Initialize a GPR regression analysis.

Parameters:
  - `kernel` (Kernel) - a kernel object defining the covariance between instances. (Defaults to KernelSquaredExponential if None in arguments)
Overrides: object.__init__

### _init_internals(self)

source code

Reset some internal variables to None.

To be used in constructor and untrain()

### __repr__(self)
(Representation operator)

source code

String summary of the object

Parameters:
  - `fullname` - Either to include full name of the module
  - `prefixes` - What other prefixes to prepend to list of arguments
Overrides: object.__repr__

### getSensitivityAnalyzer(self, flavor='auto', **kwargs)

source code

Returns a sensitivity analyzer for GPR.

Parameters:
  - `flavor` (basestring) - What sensitivity to provide. Valid values are 'linear', 'model_select', 'auto'. In case of 'auto' selects 'linear' for linear kernel and 'model_select' for the rest. 'linear' corresponds to GPRLinearWeights and 'model_select' to GRPWeights
Overrides: base.Classifier.getSensitivityAnalyzer

### _train(self, data)

source code

Train the classifier using `data` (Dataset).

Overrides: base.Classifier._train

### _predict(self, data)

source code

Predict the output for the provided data.

Overrides: base.Classifier._predict

### _setRetrainable(self, value, force=False)

source code

Internal function : need to set _km_test_test

Overrides: base.Classifier._setRetrainable

### untrain(self)

source code

Reset trained state

Overrides: base.Classifier.untrain
  (inherited documentation)

### set_hyperparameters(self, hyperparameter)

source code

Set hyperparameters' values.

Note that 'hyperparameter' is a sequence so the order of its values is important. First value must be sigma_noise, then other kernel's hyperparameters values follow in the exact order the kernel expect them to be.

Class Variable Details | [hide private]

### predicted_variances

Value:

      StateVariable(enabled= False, doc= "Variance per each predicted value"
      )

### log_marginal_likelihood

Value:

      StateVariable(enabled= False, doc= "Log Marginal Likelihood")

### log_marginal_likelihood_gradient

Value:

      StateVariable(enabled= False, doc= "Log Marginal Likelihood Gradient")

### sigma_noise

Value:

      Parameter(0.001, allowedtype= 'float', min= 1e-10, doc= "the standard
      deviation of the gaussian noise.")

### lm

Value:

      Parameter(0.0, min= 0.0, allowedtype= 'float', doc= """The regularizat
      ion term lambda.
                         Increase this when the kernel matrix is not positiv
      e, definite.""")