scikit-sos icon indicating copy to clipboard operation
scikit-sos copied to clipboard

Divide By zero

Open nakulstar95 opened this issue 6 years ago • 4 comments

/anaconda3/lib/python3.6/site-packages/scikit_sos-0.1.10-py3.6.egg/sksos/sos.py:132: RuntimeWarning: overflow encountered in multiply A = np.exp(-D * beta) /anaconda3/lib/python3.6/site-packages/scikit_sos-0.1.10-py3.6.egg/sksos/sos.py:88: RuntimeWarning: overflow encountered in multiply beta[i] = beta[i] * 2.0 /anaconda3/lib/python3.6/site-packages/scikit_sos-0.1.10-py3.6.egg/sksos/sos.py:132: RuntimeWarning: invalid value encountered in multiply A = np.exp(-D * beta) /anaconda3/lib/python3.6/site-packages/scikit_sos-0.1.10-py3.6.egg/sksos/sos.py:134: RuntimeWarning: divide by zero encountered in log H = np.log(sumA) + beta * np.sum(D * A) / sumA /anaconda3/lib/python3.6/site-packages/scikit_sos-0.1.10-py3.6.egg/sksos/sos.py:134: RuntimeWarning: invalid value encountered in true_divide H = np.log(sumA) + beta * np.sum(D * A) / sumA

nakulstar95 avatar Apr 30 '18 06:04 nakulstar95

I guess it was looping infinite times

nakulstar95 avatar Apr 30 '18 07:04 nakulstar95

how did you resolve it @nakulstar95 ?

I'm getting the following error,

C:\Anaconda\lib\site-packages\sksos\sos.py:132: RuntimeWarning:

overflow encountered in multiply

C:\Anaconda\lib\site-packages\sksos\sos.py:88: RuntimeWarning:

overflow encountered in multiply

C:\Anaconda\lib\site-packages\sksos\sos.py:132: RuntimeWarning:

invalid value encountered in multiply

sskarkhanis avatar Jul 30 '18 07:07 sskarkhanis

@nakulstar95 @sskarkhanis any suggestions on fixing this issue? I am running into this issue as well when all my values are 1.0. thanks!

xichen1995 avatar Jan 14 '20 01:01 xichen1995

@nakulstar95 @sskarkhanis any suggestions on fixing this issue? I am running into this issue as well when all my values are 1.0. thanks!

I've moved on to using the PyOD library for using outlier detection methods.

https://github.com/yzhao062/pyod

It does allow you to use SOS but in my experience on using it even with pyOD, SOS doesnt work well and can be buggy. Good news is that you can use the other methods there which work.

sskarkhanis avatar Feb 17 '20 04:02 sskarkhanis