Skip to content

Commit ab175b4

Browse files
Sameer AbhyankarSameer Abhyankar
Sameer Abhyankar
authored and
Sameer Abhyankar
committed
Fix merge conflicts, rearrange imports and style checks
1 parent e616b76 commit ab175b4

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,15 @@ import java.lang.{Iterable => JIterable}
2121

2222
import scala.collection.JavaConverters._
2323

24-
import org.json4s.JsonDSL._
25-
import org.json4s.jackson.JsonMethods._
26-
2724
import org.apache.spark.{Logging, SparkContext, SparkException}
2825
import org.apache.spark.annotation.Since
2926
import org.apache.spark.mllib.linalg.{BLAS, DenseMatrix, DenseVector, SparseVector, Vector}
3027
import org.apache.spark.mllib.regression.LabeledPoint
3128
import org.apache.spark.mllib.util.{Broadcastable, Loader, Saveable}
3229
import org.apache.spark.rdd.RDD
3330
import org.apache.spark.sql.{DataFrame, SQLContext}
31+
import org.json4s.JsonDSL._
32+
import org.json4s.jackson.JsonMethods._
3433

3534
/**
3635
* Model for Naive Bayes Classifiers.
@@ -47,7 +46,7 @@ class NaiveBayesModel private[spark] (
4746
@Since("0.9.0") val pi: Array[Double],
4847
@Since("0.9.0") val theta: Array[Array[Double]],
4948
@Since("1.4.0") val modelType: String)
50-
extends ClassificationModel with Serializable with Saveable {
49+
extends ClassificationModel with Serializable with Saveable with Broadcastable[NaiveBayesModel] {
5150

5251
import NaiveBayes.{Bernoulli, Multinomial, supportedModelTypes}
5352

mllib/src/main/scala/org/apache/spark/mllib/util/ModelBroadcast.scala

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,15 @@
1717

1818
package org.apache.spark.mllib.util
1919

20-
import org.apache.spark.broadcast.Broadcast
21-
import org.apache.spark.SparkContext
22-
2320
import scala.reflect.ClassTag
2421

25-
private[mllib] trait Broadcastable[T] {
22+
import org.apache.spark.SparkContext
23+
import org.apache.spark.broadcast.Broadcast
24+
25+
private[spark] trait Broadcastable[T] {
2626

2727
private var bcModel: Option[Broadcast[T]] = None
28+
2829
/**
2930
* Checks whether the model object is already broadcast and returns the reference.
3031
* If not, then broadcasts the model and returns a reference

0 commit comments

Comments
 (0)