On Tue, 03 Jul 2012, Olivier Grisel wrote:

> 2012/7/2 Yaroslav Halchenko <[email protected]>:
> > Just now spotted that sklearn hasn't migrated to wheezy yet because of

> > Tail of log for scikit-learn on armel:

> > Traceback (most recent call last):
> >   File "/usr/lib/python2.7/dist-packages/nose/case.py", line 197, in runTest
> >     self.test(*self.arg)
> >   File 
> > "/build/buildd-scikit-learn_0.11.0-1-armel-QM4IQa/scikit-learn-0.11.0/debian/python-sklearn/usr/lib/python2.7/dist-packages/sklearn/feature_extraction/tests/test_text.py",
> >  line 265, in test_tfidf_no_smoothing
> >     assert_equal(len(w), 1)
> > AssertionError: 0 != 1

> No idea for that one.

this one is funny -- apparently on armel it (numpy) doesn't care to spit
out warning about division by 0:

(Pdb) print df
[ 3.  2.  0.]
(Pdb) n
> /home/yoh/sklearn/scikit-learn-0.11.0/sklearn/feature_extraction/text.py(581)fit()
-> self.idf_ = np.log(float(n_samples) / df) + 1.0
(Pdb) n
> /home/yoh/sklearn/scikit-learn-0.11.0/sklearn/feature_extraction/text.py(583)fit()
-> return self

apparently warnings are not that reliable altogether across numpy
versions / architectures:

$> python -c 'import numpy as np; from platform import platform; print 
np.__version__, platform(); 1.0 / np.array([0.])'
1.6.2 Linux-3.1.0-1-amd64-x86_64-with-debian-wheezy-sid
-c:1: RuntimeWarning: divide by zero encountered in divide

$> python -c 'import numpy as np; from platform import platform; print 
np.__version__, platform(); 1.0 / np.array([0.])'
1.4.1 Linux-2.6.32-5-amd64-x86_64-with-debian-6.0.4

(sid)yoh@abel:~$ python -c 'import numpy as np; from platform import platform; 
print np.__version__, platform(); 1.0 / np.array([0.])'
1.6.2 Linux-2.6.32-armv5tel-with-debian-wheezy-sid

So IMHO it would be the best to condition that test on numpy reporting
the warnings.

Please review/accept/adopt
https://github.com/scikit-learn/scikit-learn/pull/928

> > Tail of log for scikit-learn on mipsel:

> >     self.test(*self.arg)
> >   File 
> > "/build/buildd-scikit-learn_0.11.0-1-mipsel-ZOiuQA/scikit-learn-0.11.0/debian/python-sklearn/usr/lib/python2.6/dist-packages/sklearn/covariance/tests/test_robust_covariance.py",
> >  line 28, in test_mcd
> >     launch_mcd_on_dataset(100, 5, 20, 0.01, 0.01, 70)
> >   File 
> > "/build/buildd-scikit-learn_0.11.0-1-mipsel-ZOiuQA/scikit-learn-0.11.0/debian/python-sklearn/usr/lib/python2.6/dist-packages/sklearn/covariance/tests/test_robust_covariance.py",
> >  line 67, in launch_mcd_on_dataset
> >     assert(error_cov < tol_cov)
> > AssertionError

> Fixed in: 
> https://github.com/scikit-learn/scikit-learn/commit/071cdb0982e1356552fc07b9cdd5d2ec2625add5

Thanks -- I will pick up this "lucky to succeed once" fix ;)

-- 
Yaroslav O. Halchenko
Postdoctoral Fellow,   Department of Psychological and Brain Sciences
Dartmouth College, 419 Moore Hall, Hinman Box 6207, Hanover, NH 03755
Phone: +1 (603) 646-9834                       Fax: +1 (603) 646-1419
WWW:   http://www.linkedin.com/in/yarik        

------------------------------------------------------------------------------
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