On Thu, May 24, 2012 at 10:47 AM, Olivier Grisel <[email protected]> wrote: > 2012/5/24 Ian Goodfellow <[email protected]>: >> Well that's the thing, coef_ and intercept_ seem wrong, given the >> results of my script below. My implementation of predict based on >> coef_ only agrees with predict 50% of the time. >> Does anyone know if coef_ and intercept_ are just getting set wrong? >> Or does predict implement a different decision function than >> (X*coef_+intercept_)>0? > > If X is dense then this should be, for binary classification with a > linear kernel: > > np.dot(X, clf.coef_) - clf.intercept > 0 (if I remember correctly the > sign of the intercept)
I've tried both signs of the intercept and neither one agrees with the predict function. > > Off course this formula is specific to the dense linear case. It won't > work for the SVC models with kernels. Yes, of course. You'll notice that my debugging script uses kernel = 'linear'... > > -- > Olivier > http://twitter.com/ogrisel - http://github.com/ogrisel > > ------------------------------------------------------------------------------ > 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
