Github user jkbradley commented on a diff in the pull request:
https://github.com/apache/spark/pull/6277#discussion_r30744735
--- Diff:
mllib/src/test/scala/org/apache/spark/mllib/classification/NaiveBayesSuite.scala
---
@@ -58,19 +58,16 @@ object NaiveBayesSuite {
for (i <- 0 until nPoints) yield {
val y = calcLabel(rnd.nextDouble(), _pi)
val xi = modelType match {
- case "Bernoulli" => Array.tabulate[Double] (D) { j =>
+ case Bernoulli => Array.tabulate[Double] (D) { j =>
if (rnd.nextDouble () < _theta(y)(j) ) 1 else 0
}
- case "Multinomial" =>
+ case Multinomial =>
val mult = BrzMultinomial(BDV(_theta(y)))
val emptyMap = (0 until D).map(x => (x, 0.0)).toMap
val counts = emptyMap ++ mult.sample(sample).groupBy(x => x).map
{
case (index, reps) => (index, reps.size.toDouble)
}
counts.toArray.sortBy(_._1).map(_._2)
- case _ =>
--- End diff --
Does removing this cause a compilation warning?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]