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