np.dot(X.T, X) is invertible.None of the features have a 0 variance and I don't 
think they are correlated.
"Would you look at the eigenvalues of this thing please?"
I calculated the eigenvalues in the following manner. Sorry, I am not sure 
if this is what you wanted me to do or what I should look for.
>>> print np.linalg.eig(np.dot(X.T,X))array([  6.98841511e+03, 
  3.74800914e+02,   1.91861359e+02,        
 1.60115903e+02,   1.43342111e+02,   1.32635349e+02,  
       1.05821870e+02,   1.04876518e+02,   
9.35168895e+01,         8.17388838e+01,   
7.32905453e+01,   6.78274062e+01,        
 3.00527208e+01,   3.49964917e+01,   3.54243068e+01,  
       4.34113226e+01,   5.59046873e+01,   
4.89676135e+01,         5.16760071e-14, 
 -4.21817181e-15])

From: Virgile Fritsch <[email protected]>
Sent: Thu, 28 Jun 2012 17:44:35 
To: [email protected]
Subject: Re: [Scikit-learn-general] EllipticEnvelope giving error IndexError: 
0-d arrays can't be indexed
It may come from the fact that np.dot(X, X.T) is not invertible.


I meant, of course, np.dot(X.T, X).
Would you look at the eigenvalues of this thing please?

On Thu, Jun 28, 2012 at 10:33 AM, Virgile Fritsch 
<[email protected]> wrote:


Hi,

It may come from the fact that np.dot(X, X.T) is not invertible.
Is it possible that two (or more) features are correlated? Or that one (or 
more) features have a 0 variance?


If yes, try to remove those features.


Let us know if you think this could be the reason why it fails.

Virgile



On Thu, Jun 28, 2012 at 1:08 AM, ert <[email protected]> wrote:



Hi,
I am trying to use EllipticEnvelope for outlier detection but it results in an 
error when trying to use the m.fit(X)  function (stacktrace below). 
Here m  = EllipticEnvelope(contamination=0.1)



X.shape gives output (731, 22)X is not a sparse matrix.
Initially, I thought there was some prob with my X, howeverm = OneClassSVM()


m.fit(X)runs fine without any errors. I am not sure if these are 
related. Any idea what could be causing this?
StackTrace (note 'instances' is a list of lists):-


Traceback (most recent call last):  File "create_classifier_new.py", line 
274, in <module>    m.fit(numpy.array(instances))  File 
"/usr/local/lib/python2.6/dist-packages/scikit_learn-0.12_git-py2.6-linux-x86_64.egg/sklearn/covariance/outlier_detection.py",
 line 176, in fit


    MinCovDet.fit(self, X)  File 
"/usr/local/lib/python2.6/dist-packages/scikit_learn-0.12_git-py2.6-linux-x86_64.egg/sklearn/covariance/robust_covariance.py",
 line 513, in fit    random_state=self.random_state)


  File 
"/usr/local/lib/python2.6/dist-packages/scikit_learn-0.12_git-py2.6-linux-x86_64.egg/sklearn/covariance/robust_covariance.py",
 line 360, in fast_mcd    random_state=random_state)


  File 
"/usr/local/lib/python2.6/dist-packages/scikit_learn-0.12_git-py2.6-linux-x86_64.egg/sklearn/covariance/robust_covariance.py",
 line 228, in select_candidates    random_state=random_state))


  File 
"/usr/local/lib/python2.6/dist-packages/scikit_learn-0.12_git-py2.6-linux-x86_64.egg/sklearn/covariance/robust_covariance.py",
 line 120, in c_step    if np.allclose(det, previous_det):


  File "/usr/lib/python2.6/dist-packages/numpy/core/numeric.py", line 
1671, in allclose    if not all(x[xinf] == y[xinf]):IndexError: 0-d 
arrays can't be indexed




Thanks





Follow Rediff Deal ho jaye! to get exciting offers in your city 
everyday.



------------------------------------------------------------------------------

Live Security Virtual Conference

Exclusive live event will cover all the ways today's security and

threat landscape has changed and how IT managers can respond. Discussions

will include endpoint security, mobile security and the latest in malware

threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________

Scikit-learn-general mailing list

[email protected]

https://lists.sourceforge.net/lists/listinfo/scikit-learn-general






------------------------------------------------------------------------------

Live Security Virtual Conference

Exclusive live event will cover all the ways today's security and 

threat landscape has changed and how IT managers can respond. Discussions 

will include endpoint security, mobile security and the latest in malware 

threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________

Scikit-learn-general mailing list

[email protected]

https://lists.sourceforge.net/lists/listinfo/scikit-learn-general

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Scikit-learn-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general

Reply via email to