Re: [Scikit-learn-general] How should I deal with log(0) when calculating Mutual Information?

2011-10-15 Thread Pietro Berkes
oh you're right, bad example. so it *is* a dangerous function after all ;-) On Sat, Oct 15, 2011 at 9:26 PM, wrote: > On Sat, Oct 15, 2011 at 4:12 PM, Pietro Berkes wrote: >> On Sat, Oct 15, 2011 at 9:07 PM,   wrote: >>> On Sat, Oct 15, 2011 at 3:57 PM, Pietro Berkes wrote: I wish there

Re: [Scikit-learn-general] How should I deal with log(0) when calculating Mutual Information?

2011-10-15 Thread josef . pktd
On Sat, Oct 15, 2011 at 4:12 PM, Pietro Berkes wrote: > On Sat, Oct 15, 2011 at 9:07 PM,   wrote: >> On Sat, Oct 15, 2011 at 3:57 PM, Pietro Berkes wrote: >>> I wish there was a native numpy function for this case, which is >>> fairly common in information theory quantities. >>> As a workaround,

Re: [Scikit-learn-general] How should I deal with log(0) when calculating Mutual Information?

2011-10-15 Thread Pietro Berkes
On Sat, Oct 15, 2011 at 9:07 PM, wrote: > On Sat, Oct 15, 2011 at 3:57 PM, Pietro Berkes wrote: >> I wish there was a native numpy function for this case, which is >> fairly common in information theory quantities. >> As a workaround, I sometimes use these reasonably efficient utility >> functi

Re: [Scikit-learn-general] How should I deal with log(0) when calculating Mutual Information?

2011-10-15 Thread josef . pktd
On Sat, Oct 15, 2011 at 3:57 PM, Pietro Berkes wrote: > I wish there was a native numpy function for this case, which is > fairly common in information theory quantities. > As a workaround, I sometimes use these reasonably efficient utility functions: > > def log0(x): >    """Robust 'entropy' loga

Re: [Scikit-learn-general] How should I deal with log(0) when calculating Mutual Information?

2011-10-15 Thread Pietro Berkes
I wish there was a native numpy function for this case, which is fairly common in information theory quantities. As a workaround, I sometimes use these reasonably efficient utility functions: def log0(x): """Robust 'entropy' logarithm: log(0.) = 0.""" return np.where(x==0., 0., np.log(x))

[Scikit-learn-general] Python wrapper for crfsuite

2011-10-15 Thread Jacob VanderPlas
Hello, I've begun work on a python wrapper for crfsuite ( http://www.chokkan.org/software/crfsuite/ ) with a mind toward future inclusion in scikit-learn. It still needs a lot of work, but you can take a look at the progress here: http://github.com/jakevdp/pyCRFsuite I'd appreciate any feedback