Although I haven't check the code, I guess this is the usual way to store
the coefficients. To calculate P(C=i|x), we can use the formula: exp(sum_j
Coef([i,j])/Z, where Z=sum_i exp(\sum_j Coef[i,j]).
Sincerely,
Kerui Min
On Wed, Mar 21, 2012 at 4:57 PM, Olivier Grisel <olivier.gri...@ensta.org>wrote:
> Le 21 mars 2012 07:49, Andrew Cepheus <andy.ceph...@gmail.com> a écrit :
> > The LogisticRegression class holds a coef_ attribute which is said to
> hold
> > the coefficients in the decision function.
> > High (positive) coefficients mean more correlation with the class, while
> low
> > (negative) ones mean an opposite correlation with the class.
> > - Assuming that I have two class in that target variable, to which class
> the
> > coefficients match? Is it the first class, i.e., y[0]?
>
> If there are only two classes, 0 or -1 is treated as negative and 1 is
> treated as positive.
>
> > - Why is the shape of the coefficients [n_classes-1, n_features]? if the
> > top coefficients are most correlated with the first class, then the
> bottom
> > ones are most correlated with the second class?
>
> In the multi-class case, coef_ seems to have shape [n_classes,
> n_features] (it's a one vs the rest multiclass model).
>
> I think the docstring is wrong. Anybody can confirm?
>
> --
> Olivier
> http://twitter.com/ogrisel - http://github.com/ogrisel
>
>
> ------------------------------------------------------------------------------
> This SF email is sponsosred by:
> Try Windows Azure free for 90 days Click Here
> http://p.sf.net/sfu/sfd2d-msazure
> _______________________________________________
> Scikit-learn-general mailing list
> Scikit-learn-general@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/scikit-learn-general
>
------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
Scikit-learn-general mailing list
Scikit-learn-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general