Github user sethah commented on a diff in the pull request:
https://github.com/apache/spark/pull/15435#discussion_r94620487
--- Diff:
mllib/src/main/scala/org/apache/spark/ml/classification/LogisticRegression.scala
---
@@ -1120,21 +1239,129 @@ sealed trait LogisticRegressionSummary extends
Serializable {
/** Field in "predictions" which gives the probability of each class as
a vector. */
def probabilityCol: String
+ /** Field in "predictions" which gives the prediction of each class as a
vector. */
+ def predictionCol: String
+
/** Field in "predictions" which gives the true label of each instance
(if available). */
def labelCol: String
/** Field in "predictions" which gives the features of each instance as
a vector. */
def featuresCol: String
+ /** Returns false positive rate for each label. */
+ @Since("2.1.0")
+ def falsePositiveRateByLabel: Array[Double]
+
+ /** Returns precision for each label. */
+ @Since("2.1.0")
+ def precisionByLabel: Array[Double]
+
+ /** Returns recall for each label. */
+ @Since("2.1.0")
+ def recallByLabel: Array[Double]
+
+ /**
+ * Returns f-measure for each label.
+ * @param beta the beta parameter.
+ */
+ @Since("2.1.0")
+ def fMeasureByLabel(beta: Double): Array[Double]
+
+ /** Returns f1-measure for each label. */
+ @Since("2.1.0")
+ def fMeasureByLabel: Array[Double]
+
+ /** Returns accuracy. */
+ @Since("2.1.0")
+ def accuracy: Double
+
+ /** Returns weighted false positive rate. */
+ @Since("2.1.0")
+ def weightedFalsePositiveRate: Double
+
+ /** Returns weighted averaged recall. */
+ @Since("2.1.0")
+ def weightedRecall: Double
+
+ /** Returns weighted averaged precision. */
+ @Since("2.1.0")
+ def weightedPrecision: Double
+
+ /**
+ * Returns weighted averaged f-measure.
+ * @param beta the beta parameter.
+ */
+ @Since("2.1.0")
+ def weightedFMeasure(beta: Double): Double
+
+ /** Returns weighted averaged f1-measure. */
+ @Since("2.1.0")
+ def weightedFMeasure: Double
}
/**
* :: Experimental ::
- * Logistic regression training results.
+ * Multinomial Logistic regression training results.
*
* @param predictions dataframe output by the model's `transform` method.
* @param probabilityCol field in "predictions" which gives the
probability of
* each class as a vector.
+ * @param predictionCol field in "predictions" which gives the prediction
of
+ * each class as a vector.
+ * @param labelCol field in "predictions" which gives the true label of
each instance.
+ * @param featuresCol field in "predictions" which gives the features of
each instance as a vector.
+ * @param objectiveHistory objective function (scaled loss +
regularization) at each iteration.
+ */
+@Experimental
+@Since("1.5.0")
+class MultinomialLogisticRegressionTrainingSummary private[classification]
(
+ predictions: DataFrame,
+ probabilityCol: String,
+ predictionCol: String,
+ labelCol: String,
+ featuresCol: String,
+ @Since("1.5.0") val objectiveHistory: Array[Double])
+ extends MultinomialLogisticRegressionSummary(
+ predictions, probabilityCol, predictionCol, labelCol, featuresCol)
+ with LogisticRegressionTrainingSummary {
+
+}
+
+/**
+ * :: Experimental ::
+ * Multinomial Logistic regression results for a given model.
+ *
+ * @param predictions dataframe output by the model's `transform` method.
+ * @param probabilityCol field in "predictions" which gives the
probability of
+ * each class as a vector.
+ * @param predictionCol field in "predictions" which gives the prediction
of
+ * each class as a vector.
+ * @param labelCol field in "predictions" which gives the true label of
each instance.
+ * @param featuresCol field in "predictions" which gives the features of
each instance as a vector.
+ */
+@Experimental
+@Since("1.5.0")
+class MultinomialLogisticRegressionSummary private[classification](
+ @Since("2.1.0") @transient override val predictions: DataFrame,
+ @Since("2.1.0") override val probabilityCol: String,
+ @Since("2.1.0") override val predictionCol: String,
+ @Since("2.1.0") override val labelCol: String,
+ @Since("2.1.0") override val featuresCol: String)
+ extends MulticlassSummary (
+ predictions, predictionCol, labelCol)
+ with LogisticRegressionSummary {
+
+}
+
+/**
+ * :: Experimental ::
+ * Binary Logistic regression training results.
+ *
+ * @param predictions dataframe output by the model's `transform` method.
+ * @param probabilityCol field in "predictions" which gives the
probability of
+ * each class as a vector.
+ * @param predictionCol field in "predictions" which gives the prediction
of
--- End diff --
This is not correct. Prediction column gives the prediction for a data
instance as a Double....
---
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]