Re: [Scikit-learn-general] Intersection kernel over-fitting problem

2012-09-20 Thread Andreas Mueller
>>> There should be no other parameters to tune here. >>> >>> Btw, you can try kernel_approximation.AdditiveChi2Sampler (if your data is >>> positive). > Note that this is not meant to be used as an exact kernel in a kernel > SVM but as a explicit preprocessing transformer for a linear kernel. > T

Re: [Scikit-learn-general] Intersection kernel over-fitting problem

2012-09-20 Thread Olivier Grisel
2012/9/20 abdalrahman eweiwi : > > > On Thu, Sep 20, 2012 at 1:58 PM, Andreas Mueller > wrote: >> >> >> >> return np.min(np.vstack((v[None,:],v2[None,:])),axis=0).sum() >> >> I'm not sure what the None does here, I would write >> np.minimum(v, v2).sum() >> which is the correct intersection kernel

Re: [Scikit-learn-general] Intersection kernel over-fitting problem

2012-09-20 Thread abdalrahman eweiwi
On Thu, Sep 20, 2012 at 1:58 PM, Andreas Mueller wrote: > > * > * > *return np.min(np.vstack((v[None,:],v2[None,:])),axis=0).sum(*) > > I'm not sure what the None does here, I would write > np.minimum(v, v2).sum() > which is the correct intersection kernel I think. > I know, sometimes i make thi

Re: [Scikit-learn-general] Intersection kernel over-fitting problem

2012-09-20 Thread abdalrahman eweiwi
On Thu, Sep 20, 2012 at 2:08 PM, Andreas Mueller wrote: > On 09/20/2012 01:01 PM, Gael Varoquaux wrote: > > On Thu, Sep 20, 2012 at 12:58:56PM +0100, Andreas Mueller wrote: > >> return np.min(np.vstack((v[None,:],v2[None,:])),axis=0).sum() > >> I'm not sure what the None does here, I wou

Re: [Scikit-learn-general] Intersection kernel over-fitting problem

2012-09-20 Thread Andreas Mueller
On 09/20/2012 01:01 PM, Gael Varoquaux wrote: > On Thu, Sep 20, 2012 at 12:58:56PM +0100, Andreas Mueller wrote: >> return np.min(np.vstack((v[None,:],v2[None,:])),axis=0).sum() >> I'm not sure what the None does here, I would write > None create a new axis. For readability, one should al

Re: [Scikit-learn-general] Intersection kernel over-fitting problem

2012-09-20 Thread Andreas Mueller
On 09/20/2012 01:01 PM, Gael Varoquaux wrote: > On Thu, Sep 20, 2012 at 12:58:56PM +0100, Andreas Mueller wrote: >> return np.min(np.vstack((v[None,:],v2[None,:])),axis=0).sum() >> I'm not sure what the None does here, I would write > None create a new axis. For readability, one should al

Re: [Scikit-learn-general] Intersection kernel over-fitting problem

2012-09-20 Thread Gael Varoquaux
On Thu, Sep 20, 2012 at 12:58:56PM +0100, Andreas Mueller wrote: > return np.min(np.vstack((v[None,:],v2[None,:])),axis=0).sum() >I'm not sure what the None does here, I would write None create a new axis. For readability, one should always write v[np.newaxis, :], which is equivalent.

Re: [Scikit-learn-general] Intersection kernel over-fitting problem

2012-09-20 Thread Andreas Mueller
* * *return np.min(np.vstack((v[None,:],v2[None,:])),axis=0).sum(*) I'm not sure what the None does here, I would write np.minimum(v, v2).sum() which is the correct intersection kernel I think. What are the features you use? The features have to be positive for this to work. There should be

Re: [Scikit-learn-general] Intersection kernel over-fitting problem

2012-09-20 Thread Olivier Grisel
You can also debug by printing the kernel value of pairs of samples that you know are qualitatively related and pairs that you know are qualitatively unrelated. If you kernel is positive (it should be), pairs of related samples should always have a higher value than pairs of unrelated samples. --

Re: [Scikit-learn-general] Intersection kernel over-fitting problem

2012-09-20 Thread abdalrahman eweiwi
On Thu, Sep 20, 2012 at 10:54 AM, Olivier Grisel wrote: > 2012/9/20 abdalrahman eweiwi : > > Hi, > > > > Just noticed that I coincidentally sent half of my email!! Anyway, here > is > > my question again: > > > > A couple of weeks ago I test the intersection kernel in my experiments, > for > > th

Re: [Scikit-learn-general] Intersection kernel over-fitting problem

2012-09-20 Thread Olivier Grisel
2012/9/20 abdalrahman eweiwi : > Hi, > > Just noticed that I coincidentally sent half of my email!! Anyway, here is > my question again: > > A couple of weeks ago I test the intersection kernel in my experiments, for > that I wrote the following simple procedures: > > import numpy as np > import c

Re: [Scikit-learn-general] Intersection kernel over-fitting problem

2012-09-20 Thread abdalrahman eweiwi
Hi, Just noticed that I coincidentally sent half of my email!! Anyway, here is my question again: A couple of weeks ago I test the intersection kernel in my experiments, for that I wrote the following simple procedures: import numpy as np import cv2 def intersection_dist(v1,v2): return

Re: [Scikit-learn-general] Intersection kernel over-fitting problem

2012-09-19 Thread Gael Varoquaux
On Wed, Sep 19, 2012 at 02:53:10PM +0200, abdalrahman eweiwi wrote: >Hi, >A couple of weeks ago I test the intersection kernel in my experiments, >for that I wrote the following simple procedures: >def intersection_dist(v1,v2): I am sorry, I don't believe that we got the full conte