Skip to content

Fix joblib is imported with both import and import from #14150

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 1 commit into from
Closed
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
10 changes: 5 additions & 5 deletions sklearn/datasets/lfw.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

import numpy as np
import joblib
from joblib import Memory


from .base import get_data_home, _fetch_remote, RemoteFileMetadata
from ..utils import Bunch
Expand Down Expand Up @@ -305,9 +305,9 @@ def fetch_lfw_people(data_home=None, funneled=True, resize=0.5,
# arrays for optimal memory usage
if LooseVersion(joblib.__version__) < LooseVersion('0.12'):
# Deal with change of API in joblib
m = Memory(cachedir=lfw_home, compress=6, verbose=0)
m = joblib.Memory(cachedir=lfw_home, compress=6, verbose=0)
else:
m = Memory(location=lfw_home, compress=6, verbose=0)
m = joblib.Memory(location=lfw_home, compress=6, verbose=0)
load_func = m.cache(_fetch_lfw_people)

# load and memoize the pairs as np arrays
Expand Down Expand Up @@ -476,9 +476,9 @@ def fetch_lfw_pairs(subset='train', data_home=None, funneled=True, resize=0.5,
# arrays for optimal memory usage
if LooseVersion(joblib.__version__) < LooseVersion('0.12'):
# Deal with change of API in joblib
m = Memory(cachedir=lfw_home, compress=6, verbose=0)
m = joblib.Memory(cachedir=lfw_home, compress=6, verbose=0)
else:
m = Memory(location=lfw_home, compress=6, verbose=0)
m = joblib.Memory(location=lfw_home, compress=6, verbose=0)
load_func = m.cache(_fetch_lfw_pairs)

# select the right metadata file according to the requested subset
Expand Down