Nested parallelism with scikit learn models

248 Views Asked by At

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!

1

There are 1 best solutions below

2
MaxU - stand with Ukraine On
  • 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.