I need to limit the CPU usage for the following command since it's using 100% of the CPU.
from sklearn.linear_model import LinearRegression
model = LinearRegression(fit_intercept = True, n_jobs = 1)
model.fit(df_x0, df_y0)
model.predict(df_x1)
I have set n_jobs == 1
, and I did not use multiprocessing, but still it kept CPU fully occupied for all kernels and df_y0
.
ndim == 1
, I learned that the n_jobs
would not be effective if so.
Can anyone tell me why it's using 100% of the CPU, and how to solve it in python?
Python 3.7, Linux.