diff --git a/recordlinkage/base.py b/recordlinkage/base.py old mode 100644 new mode 100755 index ec3bab6d..039e3ca5 --- a/recordlinkage/base.py +++ b/recordlinkage/base.py @@ -8,7 +8,7 @@ import warnings from abc import ABCMeta, abstractmethod -from joblib import Parallel, delayed +from joblib import Parallel, delayed, cpu_count import numpy as np @@ -538,7 +538,10 @@ def __init__(self, features=[], n_jobs=1, indexing_type='label', self.add(features) # public - self.n_jobs = n_jobs + if n_jobs == -1: + self.n_jobs = cpu_count() + else: + self.n_jobs = n_jobs self.indexing_type = indexing_type # label of position self.features = []