UPDATE - 2017:
In the current version, scikit-learn LogisticRegression() now has the n_jobs parameter for using multiple cores.
However, the actual text of the user manual suggests that several cores are still only used in the second half of the calculation. Starting with this update, the revised User Guide for LogisticRegression now says that njobs selects โThe number of CPU cores used during the cross-validation cycleโ, while the other two elements specified in the original answer, RandomForestClassifier() and RandomForestRegressor() , both states that njobs indicates "The number of jobs that will be executed in parallel for both matching and forecasting." In other words, the deliberate contrast in the wording here seems to indicate that the njobs parameter in LogisticRegression() , although currently implemented, is not actually implemented as completely or exactly the same as in the other two cases.
Thus, although it is now possible to speed up LogisticRegression() bit using several cores, I assume that it probably will not be very linear in proportion to the number of cores used, since this sounds like the initial โfitโ step (the first half of the algorithm) may not give in parallelization.
Original answer:
In my opinion, the main problem here is not in memory, but in the fact that you use only one core. According to the beginning, you boot the system at 4.34%. If your logistic regression process monopolizes 1 core out of 24, then this goes up to 100/24 โโ= 4.167%. Presumably, the remaining 0.17% takes into account any other processes that you also run on the machine, and they are allowed to receive an additional 0.17%, because they are planned by the system for parallel operation on a second, different core.
If you follow the links below and look at the scikit-learn API, you will see that some of the ensemble methods, such as RandomForestClassifier() or RandomForestRegressor() have an input parameter n_jobs , which directly controls the number of cores on which the package will try run in parallel. The class you use, LogisticRegression() does not define this input. The scikit-learn designers seem to have created an interface that is usually fairly consistent between classes, so if a specific input parameter is not defined for this class, this probably means that the developers simply could not find a way to implement for the meaningful class. Maybe the logistic regression algorithm is simply not suitable for parallelization; those. the potential speedup that could be achieved was not good enough to justify its implementation using a parallel architecture.
Assuming this is so, then no, you cannot make your code speed up. 24 kernels will not help you if the basic functions of the library are simply not intended for use in them.