Access to Faithful Naive Baye Probability in Spark MLlib

I am trying to access the previous Naive Baye prediction probability using MLlib using Java. Since the brzPi and brzTheta member variables are private, I used a hack to access the values ​​through reflection.

I am using Java and cannot find a way to use the breeze library with Java. If I am correct, the corresponding calculation is given on line number 66 in the NaiveBayesModel class,

tags (brzArgmax (brzPi + brzTheta * testData.toBreeze))

Here elementary additions and DenseVectors multiplication are given as operators that are not directly available in Java. Also, using brzArgmax is not very clear with Java for me.

Can anyone help me convert the above calculation from Scala to Java.

PS: I raised an improvement request on Jira in order to make these variables directly accessible externally in MLlib.

Thanks Jatin

+5
source share

Source: https://habr.com/ru/post/1207712/


All Articles