I hereby claim:
- I am rth on github.
- I am rth (https://keybase.io/rth) on keybase.
- I have a public key whose fingerprint is 94DD 00B1 3C91 6861 2089 6CC9 D130 5FCF C0A5 3EB5
To claim this, I am signing this object:
# -*- coding: utf-8 -*- | |
# -*- mode: python -*- | |
# Adapted from mpl_toolkits.axes_grid2 | |
# LICENSE: Python Software Foundation (http://docs.python.org/license.html) | |
from matplotlib.offsetbox import AnchoredOffsetbox | |
class AnchoredScaleBar(AnchoredOffsetbox): | |
def __init__(self, transform, sizex=0, sizey=0, labelx=None, labely=None, loc=4, | |
pad=0.1, borderpad=0.1, sep=2, prop=None, **kwargs): | |
""" |
I hereby claim:
To claim this, I am signing this object:
from math import sqrt, acos | |
import numpy as np | |
def make_test_arrays(N, norm=True): | |
X = np.random.rand(N) | |
Y = np.random.rand(N) | |
if norm: | |
X /= np.linalg.norm(X) | |
Y /= np.linalg.norm(Y) | |
return X, Y |
from sklearn.metrics import pairwise_distances | |
from sklearn.externals.joblib import Parallel, delayed, dump, load | |
import numpy as np | |
import tempfile | |
import os | |
from sklearn.utils import gen_even_slices | |
import shutil | |
os.environ['TMPDIR'] = '/dev/shm/' | |
np.random.seed(99999) |
""" | |
This script aims to benchmark different parallelization options for pairwise metrics in scikit-learn. | |
The results can be found in https://github.com/scikit-learn/scikit-learn/issues/8216 | |
The environement is setup with, | |
conda create -n sklearn-env scikit-learn==0.18.1 jupyter python==3.5 | |
and this benchmark should be run with, | |
Comment to https://twitter.com/honnibal/status/918427934700032000
For numpy with MKL installed by conda the proposed solution doesn't appear to work,
/home/rth/src/scikit-learn/sklearn/cross_validation.py:41: DeprecationWarning: This module was deprecated in version 0.18 in favor of the model_selection module into which all the refactored classes and functions are moved. Also note that the interface of the new CV iterators are different from that of this module. This module will be removed in 0.20. | |
"This module will be removed in 0.20.", DeprecationWarning) | |
/home/rth/src/scikit-learn/sklearn/grid_search.py:42: DeprecationWarning: This module was deprecated in version 0.18 in favor of the model_selection module into which all the refactored classes and functions are moved. This module will be removed in 0.20. | |
DeprecationWarning) | |
/home/rth/src/scikit-learn/sklearn/learning_curve.py:22: DeprecationWarning: This module was deprecated in version 0.18 in favor of the model_selection module into which all the functions are moved. This module will be removed in 0.20 | |
DeprecationWarning) | |
/home/rth/src/scikit-learn/sklearn/utils/validation.py:661: DataConversio |