mplearn.graphical_model.base_graph.ThresholdedGraphicalLasso

class mplearn.graphical_model.base_graph.ThresholdedGraphicalLasso(*, lambda0_scale=1, threshold_seq=None, ebic_gamma=0.5)[source]

Gaussian graphical model selection with the Thresholded Graphical Lasso estimator.

This class is designed to be used as a base graph selector on the minipatches with the mplearn.graphical_model.MPGraph class. At a high level, this estimator first gets an initial graph estimate using the Graphical Lasso at a small amount of regularization. After that, it hard-thresholds the initial graph estimate at a sequence of threshold values and then chooses the thresholded graph with the best EBIC score as the final graph estimate. See the original paper [1] for more details.

Parameters
lambda0_scalefloat, default=1

Controls the amount of regularization for Graphical Lasso to get the initial graphical model estimate. Specifically, the Graphical Lasso is fit at regularization lambda0_scale * sqrt(log(n_features)/n_samples). Hence a larger value means a sparser initial graph estimate. Note that lambda0_scale needs to be larger than 0.

threshold_seqndarray, default=None

The sequence of threshold values at which to hard-threshold the initial graph estimate from the Graphical Lasso estimator. The elements of this array should be in the interval (0.0, 1]. If set to None, the program will automatically set threshold_seq=numpy.linspace(0.1, 0.5, 9).

ebic_gammafloat, default=0.5

The gamma parameter in the extended BIC criterion [2]. A larger value encourages sparser graph estimates. Note that ebic_gamma needs to be larger than or equal to 0.

Attributes
Theta_tilde_ndarray of shape (n_features, n_features)

The final precision matrix estimate corresponding to the thresholded graph with the best EBIC score.

References

1

Yao, T. and Wang, M. and Allen, G. I., “Gaussian Graphical Model Selection for Huge Data via Minipatch Learning”, arXiv:2110.12067.

2

Foygel, R. and Drton, M., “Extended Bayesian Information Criteria for Gaussian Graphical Models”, Neural Information Processing Systems 2010.

fit(X, y=None)[source]

Fit the Thresholded Graphical Lasso model to X.

Parameters
Xndarray of shape (n_samples, n_features)

Data from which to infer the graphical model structure.

yIgnored.

Not used, present for API consistency.

Returns
selfobject

Fitted estimator.

get_params(deep=True)

Get parameters for this estimator.

Parameters
deepbool, default=True

If True, will return the parameters for this estimator and contained subobjects that are estimators.

Returns
paramsdict

Parameter names mapped to their values.

set_params(**params)

Set the parameters of this estimator.

The method works on simple estimators as well as on nested objects. The latter have parameters of the form <component>__<parameter> so that it’s possible to update each component of a nested object.

Parameters
**paramsdict

Estimator parameters.

Returns
selfestimator instance

Estimator instance.