Sklearn parallel processing not working in docker container

Viewed 581

I'm building and training some RandomForestClassifier models in sklearn. I recently found out about the n_jobs variable to use parallel processing for training and predicting. However, it seems to have the opposite effect that I'm looking for.

When n_jobs is unassigned (defaults to 1) the training/predicting will entirely use 1 core. I can see 100% CPU usage when running "top". However, when I bump it to 4, or -1 (number of cores, which is 4) the CPU usage drops to 25%.

Has anyone else run into this before and/or know of a solution?

2 Answers
Related