Skip to content
This repository was archived by the owner on May 9, 2024. It is now read-only.

Commit b61b5e2

Browse files
committed
added back compatable constructor to NaiveBayesModel to fix MIMA test failure
1 parent 5a4a534 commit b61b5e2

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

mllib/src/main/scala/org/apache/spark/mllib/classification/NaiveBayes.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ class NaiveBayesModel private[mllib] (
6262
val theta: Array[Array[Double]],
6363
val modelType: NaiveBayesModels) extends ClassificationModel with Serializable with Saveable {
6464

65+
def this(labels: Array[Double], pi: Array[Double], theta: Array[Array[Double]]) =
66+
this(labels, pi, theta, NaiveBayesModels.Multinomial)
67+
6568
private val brzPi = new BDV[Double](pi)
6669
private val brzTheta = new BDM(theta(0).length, theta.length, theta.flatten).t
6770

0 commit comments

Comments
 (0)