I would like to take an existing function (from scikit-learn for example: specifically the "predict" function), and apply it using multiple cores to some dataset.
My first naive approach:
def parallel_predict(classifier):
@dview.parallel(block=True)
def predict( matrix ):
return classifier.predict(matrix)
return predict
Doesn't work (multiple cores don't start spinning up). Is there a way to make this work?
Or some way to have "non-iterable" functions passed to a @dview.parallel
function?