IsingModel#
- class abess.graph.IsingModel[source]#
Sparse Ising model estimation via SLIDE (Sparse pairwise Logistic regression for Ising model via best-subset sElection).
Fits one LogisticRegression per node (node-wise logistic regression), then symmetrizes the resulting coefficient matrix.
- Parameters
max_support_size (int, array-like of shape (p,), or None) -- Maximum support size for each node's logistic regression. If None, defaults to min(p-2, 100) for each node.
tune_type (str, optional) -- Model selection criterion: "gic", "aic", "bic", "ebic", or "cv". Default: "gic".
ic_coef (float, optional) -- Coefficient for information criterion. Default: 1.0.
cv (int, optional) -- Number of cross-validation folds (used when tune_type="cv"). Default: 5.
graph_threshold (float, optional) -- Entries with |theta| <= graph_threshold are zeroed out. Default: 0.0.
thread (int, optional) -- Number of threads for LogisticRegression. Default: 1.
primary_model_fit_max_iter (int, optional) -- Max iterations for inner logistic solver. Default: 100.
primary_model_fit_epsilon (float, optional) -- Convergence tolerance for inner logistic solver. Default: 1e-6.
- __init__(max_support_size=None, tune_type='gic', ic_coef=1.0, cv=5, graph_threshold=0.0, thread=1, primary_model_fit_max_iter=100, primary_model_fit_epsilon=1e-06)[source]#
- fit(X, y=None, sample_weight=None)[source]#
Fit the sparse Ising model via SLIDE.
- Parameters
X (array-like of shape (n_samples, p_features)) -- Binary data with values in {-1, 1}.
y (ignored) --
sample_weight (array-like of shape (n_samples,), optional) -- Sample weights.
- Return type
self
- score(X, y=None, sample_weight=None)[source]#
Compute the pseudo-log-likelihood of X under the fitted Ising model.
- Parameters
X (array-like of shape (n_samples, p_features)) --
y (ignored) --
sample_weight (ignored) --
- Returns
Mean pseudo-log-likelihood (higher is better).
- Return type
- get_params(deep=True)#
Get parameters for this estimator.
- set_params(**params)#
Set the parameters of this estimator.
The method works on simple estimators as well as on nested objects (such as
Pipeline). The latter have parameters of the form<component>__<parameter>so that it's possible to update each component of a nested object.- Parameters
**params (dict) -- Estimator parameters.
- Returns
self -- Estimator instance.
- Return type
estimator instance
- __new__(*args, **kwargs)#