Skip to content

[MRG] addressing issue #6887, adding callable support for covariance comp. #7078

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
wants to merge 5 commits into from

Conversation

btabibian
Copy link
Contributor

Reference Issue

#6887

What does this implement/fix? Explain your changes.

Adds support for a callable computing covariance matrix.

Any other comments?

@@ -300,6 +300,12 @@ class GraphLasso(EmpiricalCovariance):
If verbose is True, the objective function and dual gap are
plotted at each iteration.

cov : can be 'empirical' or a callable. If 'empirical' is given,
empirical covariance is computed. If a callable is given it is used
to compute covariance matrix; it should take two input values,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

compute the

assert_array_almost_equal(covs['cd'], covs['lars'], decimal=4)
assert_array_almost_equal(icovs['cd'], icovs['lars'], decimal=4)

# Smoke test the estimator
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's actually more than a smoke tests, you're checking the result, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I compare the results of the object when passed with a callable to the one I compute manually and then call the graph_lasso with computed values.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I would remove that comment ;)

@amueller
Copy link
Member

lgtm apart from comments

@amueller amueller changed the title addressing issue #6887, adding callable support for covariance comp. [MRG] addressing issue #6887, adding callable support for covariance comp. Jul 26, 2016
@glemaitre
Copy link
Member

Nowadays we can pass a precomputed covariance matrix that could fulfill this needs.

@glemaitre glemaitre closed this Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants