That was exactly the problem!
Thank you!
Joe
On Sun, Mar 20, 2016 at 9:56 PM, Eibe Frank <eibe(a)waikato.ac.nz> wrote:
In the next nightly snapshot of WEKA 3.7, Logistic
will respect the
-num-decimal-places parameter. I’ve modified the code.
Cheers,
Eibe
On 21/03/2016, at 1:56 PM, Eibe Frank
<eibe(a)waikato.ac.nz> wrote:
The coefficient for “ac” in your model is probably not exactly 0? The
corresponding attribute value in your instance is huge: 2960343. Logistic
only outputs 4 decimal places for the coefficients… (There is a
-num-decimal-places parameter in recent snapshots of WEKA but it’s
currently ignored by Logistic.)
Try rescaling that attribute to a smaller range.
Cheers,
Eibe
> On 17/03/2016, at 8:32 AM, graffa dev <graffa.dev(a)gmail.com> wrote:
>
> Hi all,
> i have a big problem understanding why the probability computed by
logistic
regression do not match up with what i do "manually". The reason
is that i need to use the coefficients outputted by Weka in a real time
system but the final probability is not the same so i am wondering why.
>
here is an example:
>
>
> Coefficients...
> Class
> Variable A
> ====================
> a -0.0043
> b -0.001
> c 0
> d 0
> e 0
> f 0.0053
> g 0.0142
> h -0.0265
> i -0.405
> j -0.3087
> k 0.0023
> l -0.0118
> m -0.0106
> n 0.0094
> o -0.0024
> p 0.0122
> q 0.0023
> r -0.0196
> s 0.0006
> t -0.0359
> u -0.0002
> v 0.0007
> w 0.0005
> x -0.0131
> y -0.0011
> z 0.0011
> aa 0.0519
> ab -0.0094
> ac 0
> Intercept -54.7441
>
>
>
>
> First Instance:
> 260.0577
> 926.078
> 16976.31
> 20771.61
> 43972.99
> 308.1886
> 1044.535
> 16.65344
> 0.0438
> -1.39271
> 854
> 153.0434
> 14.47714
> 11.01138
> 674
> 140.1073
> 13.55172
> 11.02103
> 12.0239
> 13.77547
> -380.485
> -244.789
> 999.659
> 0
> 174.013
> 249.427
> 1027.644
> 1067.651
> 2960343
> class is A
>
> Output prediction from Weka:
> === Predictions on training set ===
>
> inst#, actual, predicted, error, probability distribution
> 1 1:A 1:A *0.939 0.061
>
>
> However, when i calculate manually the probability by summing the
instance's values multiplied by the coefficients (+Intercept...) and then
using exp(y*)/(exp(y*)+1)
> the result is still class A but probability
is
> 0.95085
>
> This case is not a lot different but i have others in which it is
completely
different from what weka outputs.
>
> is this a (serious) bug in Weka? or i am missing something?
>
>
> Thanks much
> Joe
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> _______________________________________________
> Wekalist mailing list
> Send posts to: Wekalist(a)list.waikato.ac.nz
> List info and subscription status:
http://list.waikato.ac.nz/mailman/listinfo/wekalist
> List etiquette:
http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
_______________________________________________
Wekalist mailing list
Send posts to: Wekalist(a)list.waikato.ac.nz
List info and subscription status:
http://list.waikato.ac.nz/mailman/listinfo/wekalist
List etiquette:
http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html