1

I want to to do nested parallelism with scikit learn logisticregressionCV inside a for loop:

for i in range(0,10):
    logisticregressionCV(n_jobs=-1)

I want to parallelize the for loop as well.

I read a lot of post but I couldn't understand much. one of the post is this and this.

NOTE: This 'for' loop is not for cross-validation. 'i' can be thought of another dataset obtained from another set of commands not mentioned here i.e i have 10 different datasets and i compute logistic regression for each dataset parallelly.

Please help! have been stuck on this problem for the past 2 days!

keineahnung2345
  • 2,635
  • 4
  • 13
  • 28

1 Answers1

1
  • First of all it's not clear why do you need this loop at all. Instead of having this loop just pass the cv=10 parameter.

  • Using parameter n_jobs=-1 already takes care of running this job in parallel on all available CPU cores.

MaxU - stand with Ukraine
  • 205,989
  • 36
  • 386
  • 419
  • hi, this 'for' loop is not for cross-validation, you can think 'i' as another set of data obtained from another set of commands(not mentioned here),i.e there are 10 set of data and I pick one dataset and use logistic regression on it(which itself is parallelised ). I want to parallelise this for loop so that logistic regression is computed for all 10 datasets simultaneously and NOT SEQUENTIALLY. – Aakash saboo Jul 14 '18 at 13:14
  • 1
    @Aakashsaboo, can you elaborate? What are you trying to do? Why and how are are you going to use `LogisticRegressionCV` for different pieces of data? What would it bring you? And how are you going to merge results? – MaxU - stand with Ukraine Jul 14 '18 at 14:47