Skip to content

Commit

Permalink
Fix compile error after simple merge
Browse files Browse the repository at this point in the history
  • Loading branch information
holdenk committed Oct 2, 2015
1 parent 6f66f2c commit 0cedd50
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -264,10 +264,13 @@ class LogisticRegression(override val uid: String)
}

override protected[spark] def train(dataset: DataFrame): LogisticRegressionModel = {
val instances = extractLabeledPoints(dataset).map {
case LabeledPoint(label: Double, features: Vector) => (label, features)
val w = if ($(weightCol).isEmpty) lit(1.0) else col($(weightCol))
val instances = dataset.select(col($(labelCol)), w, col($(featuresCol))).map {
case Row(label: Double, weight: Double, features: Vector) =>
Instance(label, weight, features)
}


val handlePersistence = dataset.rdd.getStorageLevel == StorageLevel.NONE
if (handlePersistence) instances.persist(StorageLevel.MEMORY_AND_DISK)

Expand Down

0 comments on commit 0cedd50

Please sign in to comment.