I'm trying to run a parallelised GridSearchCV
in a Jupiter Notebook on a MacBook. I get the error:
ImportError: [joblib] Attempting to do parallel computing without protecting your import on a system that does not support forking. To use parallel-computing in a script, you must protect your main loop using "if name == 'main'". Please see the joblib documentation on Parallel for more information
I've seen the following threads, but they won't work for me: the code below still produces the same error. What am I missing?
def somefunction():
gs_clf = GridSearchCV(text_clf, parameters, n_jobs=-1)
gs_clf = gs_clf.fit(df_resolved.rawtext, df_resolved['assignment_group.name'])
if __name__ == '__main__':
somefunction()