Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

MAINT Parameters for graphical_lasso #25386

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions 16 sklearn/covariance/_graph_lasso.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import numpy as np
from scipy import linalg
from joblib import Parallel
from ..utils._param_validation import Interval, HasMethods, StrOptions, validate_params

from . import empirical_covariance, EmpiricalCovariance, log_likelihood

Expand Down Expand Up @@ -78,6 +79,21 @@ def alpha_max(emp_cov):
return np.max(np.abs(A))


@validate_params(
{
"emp_cov": [np.ndarray],
"alpha": [Interval(Real, 0, None, closed="left"), None],
"cov_init": ["array-like"],
"mode": [StrOptions( {"lars", "cd"} )],
"tol": [Interval(Real, 0, None, closed="left"), None],
"enet_tol": [Interval(Real, 0, None, closed="left"), None],
"max_iter": [Interval(Integral, 0, None, closed="left"), None],
"verbose": ["boolean"],
"return_costs": ["boolean"],
"eps": [Interval(Real, 0, None, closed="left"), None],
"return_n_iter": ["boolean"]
}
)
# The g-lasso algorithm
def graphical_lasso(
emp_cov,
Expand Down
1 change: 1 addition & 0 deletions 1 sklearn/tests/test_public_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ def _check_function_param_validation(
"sklearn.model_selection.train_test_split",
"sklearn.random_projection.johnson_lindenstrauss_min_dim",
"sklearn.svm.l1_min_c",
"covariance.graphical_lasso",
]


Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.