In a PyQt5 application, is it possible to run skle

2019-06-14 12:20发布

问题:

Is it possible to run, in a qt application, without freezing the gui, let's say a sklearn gird search that use several jobs parallel (n_jobs > 1)? The problem is that joblib that is used for parallelizing sklearn code cannot run multiprocess into a thread.

For example, I'm using Gridsearch to find the best parameters for a svr, which is quite computionnaly intensive.

This question has been asked several times, but no solution found:

pyqt5-run-sklearn-calculations-on-a-separate-qthread, suggest the use of QProcess ?

multiprocessing-backed-parallel-loops-cannot-be-nested-below-threads,the threading.current_thread().name = 'MainThread' workaround does not work after the issue has been fixed

joblib-parallel-uses-only-one-core-if-started-from-qthread, rewrite the task using multiprocessing.Pool(processes=4). This method is not applicable for gridsearch embed njobs.

use sklearn cross validation train, in PyQt button, No aswers...

And any insight why this is purposely not supported (it a feature) ? It seems like it something that would be quite useful ?