| Multivariate Pattern Analysis in Python

### Navigation

- index
- next |
- previous |
- ExpPsy Project |
- NeuroDebian Project |
- PyMVPA 0.4.x Home |
- PyMVPA Home |
- Documentation »
- Module Reference »

This content refers to the previous stable release of PyMVPA. Please visit www.pymvpa.org for the most recent version of PyMVPA and its documentation.

# clfs.gpr

## Module: `clfs.gpr`

Inheritance diagram for `mvpa.clfs.gpr`:

Gaussian Process Regression (GPR).

## Classes

### `GPR`

class `mvpa.clfs.gpr.``GPR`(kernel=None, **kwargs)

  Bases: `mvpa.clfs.base.Classifier`

  Gaussian Process Regression (GPR).

  Note

  Available state variables:

  - feature_ids: Feature IDS which were used for the actual training.
  - log_marginal_likelihood: Log Marginal Likelihood
  - log_marginal_likelihood_gradient: Log Marginal Likelihood Gradient
  - predicted_variances: Variance per each predicted value
  - predicting_time+: Time (in seconds) which took classifier to predict
  - predictions+: Most recent set of predictions
  - trained_dataset: The dataset it has been trained on
  - trained_labels+: Set of unique labels it has been trained on
  - trained_nsamples+: Number of samples it has been trained on
  - training_confusion: Confusion matrix of learning performance
  - training_time+: Time (in seconds) which took classifier to train
  - values+: Internal classifier values the most recent predictions are based on

  (States enabled by default are listed with +)

  See also

  Please refer to the documentation of the base class for more information:

  `Classifier`

  Initialize a GPR regression analysis.

  Parameters:

  - kernel (Kernel) – a kernel object defining the covariance between instances. (Defaults to KernelSquaredExponential if None in arguments)
  - sigma_noise – the standard deviation of the gaussian noise. (Default: 0.001)
  - lm – The regularization term lambda. Increase this when the kernel matrix is not positive, definite. (Default: 0.0)
  - regression – Either to use ‘regression’ as regression. By default any Classifier- derived class serves as a classifier, so regression does binary classification. (Default: False)
  - retrainable – Either to enable retraining for ‘retrainable’ classifier. (Default: False)
  - enable_states (None or list of basestring) – Names of the state variables which should be enabled additionally to default ones
  - disable_states (None or list of basestring) – Names of the state variables which should be disabled

  `compute_gradient_log_marginal_likelihood`()

    Compute gradient of the log marginal likelihood. This version use a more compact formula provided by Williams and Rasmussen book.

  `compute_gradient_log_marginal_likelihood_logscale`()

    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.

  `compute_log_marginal_likelihood`()

    Compute log marginal likelihood using self.train_fv and self.labels.

  `getSensitivityAnalyzer`(flavor='auto', **kwargs)

    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

  `kernel`
  `set_hyperparameters`(hyperparameter)

    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.

  `untrain`()

### `GPRLinearWeights`

class `mvpa.clfs.gpr.``GPRLinearWeights`(clf, force_training=True, **kwargs)

  Bases: `mvpa.measures.base.Sensitivity`

  SensitivityAnalyzer that reports the weights GPR trained on a given Dataset.

  In case of KernelLinear compute explicitly the coefficients of the linear regression, together with their variances (if requested).

  Note that the intercept is not computed.

  Note

  Available state variables:

  - base_sensitivities: Stores basic sensitivities if the sensitivity relies on combining multiple ones
  - null_prob+: State variable
  - null_t: State variable
  - raw_results: Computed results before applying any transformation algorithm
  - variances: Variances of the weights (for KernelLinear)

  (States enabled by default are listed with +)

  See also

  Please refer to the documentation of the base class for more information:

  `Sensitivity`

  Initialize the analyzer with the classifier it shall use.

  Parameters:

  - clf (`Classifier`) – classifier to use.
  - force_training (Bool) – if classifier was already trained – do not retrain
  - enable_states (None or list of basestring) – Names of the state variables which should be enabled additionally to default ones
  - disable_states (None or list of basestring) – Names of the state variables which should be disabled
  - combiner (Functor) – The combiner is only applied if the computed featurewise dataset measure is more than one-dimensional. This is different from a transformer, which is always applied. By default, the sum of absolute values along the second axis is computed.
  - transformer (Functor) – This functor is called in __call__() to perform a final processing step on the to be returned dataset measure. If None, nothing is called
  - null_dist (instance of distribution estimator) – The estimated distribution is used to assign a probability for a certain value of the computed measure.

### Navigation

- index
- next |
- previous |
- ExpPsy Project |
- NeuroDebian Project |
- PyMVPA 0.4.x Home |
- PyMVPA Home |
- Documentation »
- Module Reference »