GraphLasso
¶
-
class
ibex.sklearn.covariance.
GraphLasso
(alpha=0.01, mode='cd', tol=0.0001, enet_tol=0.0001, max_iter=100, verbose=False, assume_centered=False)¶ Bases:
sklearn.covariance.graph_lasso_.GraphLasso
,ibex._base.FrameMixin
Note
The documentation following is of the class wrapped by this class. There are some changes, in particular:
- A parameter
X
denotes apandas.DataFrame
. - A parameter
y
denotes apandas.Series
.
Sparse inverse covariance estimation with an l1-penalized estimator.
Read more in the User Guide.
- alpha : positive float, default 0.01
- The regularization parameter: the higher alpha, the more regularization, the sparser the inverse covariance.
- mode : {‘cd’, ‘lars’}, default ‘cd’
- The Lasso solver to use: coordinate descent or LARS. Use LARS for very sparse underlying graphs, where p > n. Elsewhere prefer cd which is more numerically stable.
- tol : positive float, default 1e-4
- The tolerance to declare convergence: if the dual gap goes below this value, iterations are stopped.
- enet_tol : positive float, optional
- The tolerance for the elastic net solver used to calculate the descent direction. This parameter controls the accuracy of the search direction for a given column update, not of the overall parameter estimate. Only used for mode=’cd’.
- max_iter : integer, default 100
- The maximum number of iterations.
- verbose : boolean, default False
- If verbose is True, the objective function and dual gap are plotted at each iteration.
- assume_centered : boolean, default False
- If True, data are not centered before computation. Useful when working with data whose mean is almost, but not exactly zero. If False, data are centered before computation.
- covariance_ : array-like, shape (n_features, n_features)
- Estimated covariance matrix
- precision_ : array-like, shape (n_features, n_features)
- Estimated pseudo inverse matrix.
- n_iter_ : int
- Number of iterations run.
graph_lasso, GraphLassoCV
-
fit
(X, y=None)[source]¶ Note
The documentation following is of the class wrapped by this class. There are some changes, in particular:
- A parameter
X
denotes apandas.DataFrame
. - A parameter
y
denotes apandas.Series
.
Fits the GraphLasso model to X.
- X : ndarray, shape (n_samples, n_features)
- Data from which to compute the covariance estimate
y : (ignored)
- A parameter
-
score
(X_test, y=None)¶ Note
The documentation following is of the class wrapped by this class. There are some changes, in particular:
- A parameter
X
denotes apandas.DataFrame
. - A parameter
y
denotes apandas.Series
.
- Computes the log-likelihood of a Gaussian data set with
self.covariance_ as an estimator of its covariance matrix.
- X_test : array-like, shape = [n_samples, n_features]
- Test data of which we compute the likelihood, where n_samples is the number of samples and n_features is the number of features. X_test is assumed to be drawn from the same distribution than the data used in fit (including centering).
y : not used, present for API consistence purpose.
- res : float
- The likelihood of the data set with self.covariance_ as an estimator of its covariance matrix.
- A parameter
- A parameter