Skip to content

Commit

Permalink
do not persist before calling binary classification metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
mengxr committed Nov 11, 2014
1 parent f51cd27 commit 228a9f4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion mllib/src/main/scala/org/apache/spark/ml/Model.scala
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ abstract class Model[M <: Model[M]] extends Transformer {
val parent: Estimator[M]

/**
* Fitting parameters, such that parent.fit(..., trainingParamMap) could reproduce the model.
* Fitting parameters, such that parent.fit(..., fittingParamMap) could reproduce the model.
*/
val fittingParamMap: ParamMap
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class BinaryClassificationEvaluator extends Evaluator with Params
val scoreAndLabels = dataset.select(map(scoreCol).attr, map(labelCol).attr)
.map { case Row(score: Double, label: Double) =>
(score, label)
}.persist(StorageLevel.MEMORY_AND_DISK)
}
val metrics = new BinaryClassificationMetrics(scoreAndLabels)
val metric = map(metricName) match {
case "areaUnderROC" =>
Expand All @@ -63,7 +63,7 @@ class BinaryClassificationEvaluator extends Evaluator with Params
case other =>
throw new IllegalArgumentException(s"Do not support metric $other.")
}
scoreAndLabels.unpersist()
metrics.unpersist()
metric
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import scala.collection.mutable
import org.apache.spark.ml.param._

/**
* Builder for a param grid used in grid search.
* Builder for a param grid used in grid search-based model selection.
*/
class ParamGridBuilder {

Expand Down

0 comments on commit 228a9f4

Please sign in to comment.