spark-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adamantios Corais <>
Subject How to compute the probability of each class in Naive Bayes
Date Fri, 28 Aug 2015 12:38:04 GMT

I am trying to change the following code so as to get the probabilities of
the input Vector on each class (instead of the class itself with the
highest probability). I know that this is already available as part of the
most recent release of Spark but I have to use Spark 1.1.0.

Any help is appreciated.

override def predict(testData: Vector): Double = {
>     labels(brzArgmax(brzPi + brzTheta * testData.toBreeze))
>   }

*// Adamantios*

View raw message