Re: Accessing posterior probability of Naive Baye's prediction

2014-11-28 Thread jatinpreet
-user-list.1001560.n3.nabble.com/Accessing-posterior-probability-of-Naive-Baye-s-prediction-tp19828p19975.html To unsubscribe from Accessing posterior probability of Naive Baye's prediction, click here http://apache-spark-user-list.1001560.n3.nabble.com/template/NamlServlet.jtp?macro

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

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

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

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.DenseVectorDouble. 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?

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