Jung Hun Kim
Jung Hun Kim

Reputation: 19

getting a warning on k-means

I am running a k-means cluster analysis in python and am getting a warning.

UserWarning: KMeans is known to have a memory leak on Windows with MKL, when there are less chunks than available threads. You can avoid it by setting the environment variable OMP_NUM_THREADS=1.
  

I have tried to set the environ variable

import os
os.environ["OMP_NUM_THREADS"] = '1'

But the warnings don't go away, and it looks like the variable is not persistent (when i restart python, it's not there anymore) which got me searching through stackoverflow and found the following sites

answer

answer

answer

Bear in mind I am on the work PC and I have no admin rights. So my question are:

  1. What happens if I just ignore the warning and keep using k-means? The results look fine as it is but would not want to kick the can down the road.
  2. Is there any solution that doesn't involve admin rights or writing scripts (not that i am familiar with anyways)?

Since I am beginning to use python extensively and other modules with similar issues, I would like to tackle this problem sooner than later.

Thanks, Jung

Upvotes: 0

Views: 23

Answers (1)

u38cg
u38cg

Reputation: 33

You don't need admin rights to set user environment variables. Type 'env' into your start menu and look for a 'Edit environment variables for your account'. Add it in there. You will need to restart your shell/IDE/platform to make it available.

Upvotes: -1

Related Questions