Re: Accessing posterior probability of Naive Baye's prediction

2014-11-28 Thread jatinpreet
] > <http://user/SendEmail.jtp?type=node&node=19975&i=1> > For additional commands, e-mail: [hidden email] > <http://user/SendEmail.jtp?type=node&node=19975&i=2> > > > > ------ > If you reply to this email, your message wi

Re: Accessing posterior probability of Naive Baye's prediction

2014-11-27 Thread Sean Owen
No, the feature vector is not converted. It contains count n_i of how often each term t_i occurs (or a TF-IDF transformation of those). You are finding the class c such that P(c) * P(t_1|c)^n_1 * ... is maximized. In log space it's log(P(c)) + n_1*log(P(t_1|c)) + ... So your n_1 counts (or TF-IDF

Re: Accessing posterior probability of Naive Baye's prediction

2014-11-27 Thread jatinpreet
Hi, I have been running through some troubles while converting the code to Java. I have done the matrix operations as directed and tried to find the maximum score for each category. But the predicted category is mostly different from the prediction done by MLlib. I am fetching iterators of the pi

Re: Accessing posterior probability of Naive Baye's prediction

2014-11-26 Thread jatinpreet
Hi Sean, The values brzPi and brzTheta are of the form breeze.linalg.DenseVector. So would I have to convert them back to simple vectors and use a library to perform addition/multiplication? If yes, can you please point me to the conversion logic and vector operation library for Java? Thanks, Ja

Re: Accessing posterior probability of Naive Baye's prediction

2014-11-26 Thread Sean Owen
You can call Scala code from Java, even when it involves overloaded operators, since they are also just methods with names like $plus and $times. In this case, it's not quite feasible since the Scala API is complex and would end up forcing you to manually supply some other implementation details to

Accessing posterior probability of Naive Baye's prediction

2014-11-25 Thread jatinpreet
Hi, I am trying to access the posterior probability of Naive Baye's prediction with MLlib using Java. As the member variables brzPi and brzTheta are private, I applied a hack to access the values through reflection. I am using Java and couldn't find a way to use the breeze library with Java. If I