Table Of Contents

Previous topic

clfs.enet

Next topic

clfs.gnb

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.glmnet

Module: clfs.glmnet

Inheritance diagram for mvpa.clfs.glmnet:

GLM-Net (GLMNET) regression classifier.

Classes

GLMNETWeights

class mvpa.clfs.glmnet.GLMNETWeights(clf, force_training=True, **kwargs)

Bases: mvpa.measures.base.Sensitivity

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

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

(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.

GLMNET_C

class mvpa.clfs.glmnet.GLMNET_C(**kwargs)

Bases: mvpa.clfs.glmnet._GLMNET

GLM-NET Multinomial Classifier.

This is the GLM-NET algorithm from

Friedman, J., Hastie, T. and Tibshirani, R. (2008) Regularization Paths for Generalized Linear Models via Coordinate Descent. http://www-stat.stanford.edu/~hastie/Papers/glmnet.pdf

parameterized to be a multinomial classifier.

See GLMNET_Class for the gaussian regression version.

Note

Available state variables:

  • feature_ids: Feature IDS which were used for the actual training.
  • 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:

_GLMNET

Initialize GLM-Net multinomial classifier.

See the help in R for further details on the parameters

Parameters:
  • family – Response type of your labels (either ‘gaussian’ for regression or ‘multinomial’ for classification). (Default: gaussian)
  • alpha – The elastic net mixing parameter. Larger values will give rise to less L2 regularization, with alpha=1.0 as a true LASSO penalty. (Default: 1.0)
  • nlambda – Maximum number of lambdas to calculate before stopping if not converged. (Default: 100)
  • standardize – Whether to standardize the variables prior to fitting. (Default: True)
  • thresh – Convergence threshold for coordinate descent. (Default: 0.0001)
  • pmax – Limit the maximum number of variables ever to be nonzero. (Default: None)
  • maxit – Maximum number of outer-loop iterations for ‘multinomial’ families. (Default: 100)
  • model_type – ‘covariance’ saves all inner-products ever computed and can be much faster than ‘naive’. The latter can be more efficient for nfeatures>>nsamples situations. (Default: covariance)
  • 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

GLMNET_R

class mvpa.clfs.glmnet.GLMNET_R(**kwargs)

Bases: mvpa.clfs.glmnet._GLMNET

GLM-NET Gaussian Regression Classifier.

This is the GLM-NET algorithm from

Friedman, J., Hastie, T. and Tibshirani, R. (2008) Regularization Paths for Generalized Linear Models via Coordinate Descent. http://www-stat.stanford.edu/~hastie/Papers/glmnet.pdf

parameterized to be a regression.

See GLMNET_C for the multinomial classifier version.

Note

Available state variables:

  • feature_ids: Feature IDS which were used for the actual training.
  • 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:

_GLMNET

Initialize GLM-Net.

See the help in R for further details on the parameters

Parameters:
  • family – Response type of your labels (either ‘gaussian’ for regression or ‘multinomial’ for classification). (Default: gaussian)
  • alpha – The elastic net mixing parameter. Larger values will give rise to less L2 regularization, with alpha=1.0 as a true LASSO penalty. (Default: 1.0)
  • nlambda – Maximum number of lambdas to calculate before stopping if not converged. (Default: 100)
  • standardize – Whether to standardize the variables prior to fitting. (Default: True)
  • thresh – Convergence threshold for coordinate descent. (Default: 0.0001)
  • pmax – Limit the maximum number of variables ever to be nonzero. (Default: None)
  • maxit – Maximum number of outer-loop iterations for ‘multinomial’ families. (Default: 100)
  • model_type – ‘covariance’ saves all inner-products ever computed and can be much faster than ‘naive’. The latter can be more efficient for nfeatures>>nsamples situations. (Default: covariance)
  • regression – Either to use ‘regression’ as regression. By default any Classifier- derived class serves as a classifier, so regression does binary classification. (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