Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
scikit-learn
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ian Johnson
scikit-learn
Commits
cfeab0e8
Commit
cfeab0e8
authored
13 years ago
by
Gael Varoquaux
Browse files
Options
Downloads
Patches
Plain Diff
BUG: update tests to changes in graph_lasso
parent
9eec7959
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
sklearn/covariance/tests/test_graph_lasso.py
+4
-2
4 additions, 2 deletions
sklearn/covariance/tests/test_graph_lasso.py
with
4 additions
and
2 deletions
sklearn/covariance/tests/test_graph_lasso.py
+
4
−
2
View file @
cfeab0e8
...
...
@@ -6,7 +6,8 @@ from StringIO import StringIO
import
numpy
as
np
from
scipy
import
linalg
from
sklearn.covariance
import
graph_lasso
,
GraphLasso
,
GraphLassoCV
from
sklearn.covariance
import
graph_lasso
,
GraphLasso
,
GraphLassoCV
,
\
empirical_covariance
from
sklearn.datasets.samples_generator
import
make_sparse_spd_matrix
from
sklearn.utils
import
check_random_state
...
...
@@ -20,11 +21,12 @@ def test_graph_lasso(random_state=0):
random_state
=
random_state
)
cov
=
linalg
.
inv
(
prec
)
X
=
random_state
.
multivariate_normal
(
np
.
zeros
(
dim
),
cov
,
size
=
n_samples
)
emp_cov
=
empirical_covariance
(
X
)
for
alpha
in
(.
1
,
.
01
):
covs
=
dict
()
for
method
in
(
'
cd
'
,
'
lars
'
):
cov_
,
_
,
costs
=
graph_lasso
(
X
,
alpha
=
.
1
,
return_costs
=
True
)
cov_
,
_
,
costs
=
graph_lasso
(
emp_cov
,
alpha
=
.
1
,
return_costs
=
True
)
covs
[
method
]
=
cov_
costs
,
dual_gap
=
np
.
array
(
costs
).
T
# Check that the costs always decrease
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment