Github user MechCoder commented on a diff in the pull request:
https://github.com/apache/spark/pull/7538#discussion_r35099192
--- Diff:
mllib/src/main/scala/org/apache/spark/ml/classification/LogisticRegression.scala
---
@@ -407,6 +449,60 @@ private[classification] class MultiClassSummarizer
extends Serializable {
}
}
+@Experimental
+class LogisticRegressionTrainingSummary private[classification] (
+ predictions: DataFrame,
+ probabilityCol: String,
+ labelCol: String,
+ val objectiveHistory: Array[Double])
+ extends LogisticRegressionSummary(predictions, probabilityCol, labelCol)
{
+
+ /** Number of training iterations until termination */
+ val totalIterations = objectiveHistory.length
+
+}
+
+@Experimental
+class LogisticRegressionSummary private[classification] (
+ @transient val predictions: DataFrame,
+ val probabilityCol: String,
+ val labelCol: String) extends Serializable {
+
+ @transient val metrics = new BinaryClassificationMetrics(
+ predictions.select(probabilityCol, labelCol).map {
+ case Row(score: Vector, label: Double) => (score(1), label)
+ }
+ )
+
+ /**
+ * Returns the receiver operating characteristic (ROC) curve,
+ * which is an RDD of (false positive rate, true positive rate)
+ * with (0.0, 0.0) prepended and (1.0, 1.0) appended to it.
+ */
+ val roc: RDD[(Double, Double)] = metrics.roc()
--- End diff --
This is controlled by the numBins parameter (that I did not see). Any idea
how to make this accessible to the user?
---
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]