|
21 | 21 | from ..utils.validation import check_random_state, check_array |
22 | 22 | from ..linear_model import lars_path |
23 | 23 | from ..linear_model import cd_fast |
24 | | -from ..cross_validation import check_cv, cross_val_score |
| 24 | +from ..model_selection import check_cv, cross_val_score |
25 | 25 | from ..externals.joblib import Parallel, delayed |
26 | 26 | import collections |
27 | 27 |
|
@@ -580,7 +580,7 @@ def fit(self, X, y=None): |
580 | 580 | emp_cov = empirical_covariance( |
581 | 581 | X, assume_centered=self.assume_centered) |
582 | 582 |
|
583 | | - cv = check_cv(self.cv, X, y, classifier=False) |
| 583 | + cv = check_cv(self.cv, y, classifier=False) |
584 | 584 |
|
585 | 585 | # List of (alpha, scores, covs) |
586 | 586 | path = list() |
@@ -612,14 +612,13 @@ def fit(self, X, y=None): |
612 | 612 | this_path = Parallel( |
613 | 613 | n_jobs=self.n_jobs, |
614 | 614 | verbose=self.verbose |
615 | | - )( |
616 | | - delayed(graph_lasso_path)( |
617 | | - X[train], alphas=alphas, |
618 | | - X_test=X[test], mode=self.mode, |
619 | | - tol=self.tol, enet_tol=self.enet_tol, |
620 | | - max_iter=int(.1 * self.max_iter), |
621 | | - verbose=inner_verbose) |
622 | | - for train, test in cv) |
| 615 | + )(delayed(graph_lasso_path)(X[train], alphas=alphas, |
| 616 | + X_test=X[test], mode=self.mode, |
| 617 | + tol=self.tol, |
| 618 | + enet_tol=self.enet_tol, |
| 619 | + max_iter=int(.1 * self.max_iter), |
| 620 | + verbose=inner_verbose) |
| 621 | + for train, test in cv.split(X, y)) |
623 | 622 |
|
624 | 623 | # Little danse to transform the list in what we need |
625 | 624 | covs, _, scores = zip(*this_path) |
|
0 commit comments