Package mvpa :: Package clfs :: Module model_selector :: Class ModelSelector

[hide private]
[frames] | no frames]

# Class ModelSelector

source code

Model selection facility.

Select a model among multiple models (i.e., a parametric model, parametrized by a set of hyperparamenters).

Instance Methods | [hide private]

__init__(self, parametric_model, dataset) x.__init__(...) initializes x; see help(type(x)) for signature | source code

max_log_marginal_likelihood(self, hyp_initial_guess, maxiter=1, optimization_algorithm="scipy_cg", ftol=1.0e-3, fixedHypers=None, use_gradient=False, logscale=False) Set up the optimization problem in order to maximize the log_marginal_likelihood. | source code

solve(self, problem=None) Solve the maximization problem, check outcome and collect results. | source code

Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__repr__`, `__setattr__`, `__sizeof__`, `__str__`, `__subclasshook__`

Properties | [hide private]

Inherited from `object`: `__class__`

Method Details | [hide private]

### __init__(self, parametric_model, dataset)
(Constructor)

source code

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
  (inherited documentation)

### max_log_marginal_likelihood(self, hyp_initial_guess, maxiter=1, optimization_algorithm="scipy_cg", ftol=1.0e-3, fixedHypers=None, use_gradient=False, logscale=False)

source code

Set up the optimization problem in order to maximize the log_marginal_likelihood.

NOTE: the maximization of log_marginal_likelihood is a non-linear optimization problem (NLP). This fact is confirmed by Dmitrey, author of OpenOpt.

Parameters:
  - `parametric_model` (Classifier) - the actual parameteric model to be optimized.
  - `hyp_initial_guess` (numpy.ndarray) - set of hyperparameters' initial values where to start optimization.
  - `optimization_algorithm` (string) - actual name of the optimization algorithm. See http://scipy.org/scipy/scikits/wiki/NLP for a comprehensive/updated list of available NLP solvers. (Defaults to 'ralg')
  - `ftol` (float) - threshold for the stopping criterion of the solver, which is mapped in OpenOpt NLP.ftol (Defaults to 1.0e-3)
  - `fixedHypers` (numpy.ndarray (boolean array)) - boolean vector of the same size of hyp_initial_guess; 'False' means that the corresponding hyperparameter must be kept fixed (so not optimized). (Defaults to None, which during means all True)