Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
address some commments
  • Loading branch information
zhengruifeng committed Oct 18, 2019
commit f46046cdf8370a77d77f5afbaab6d4230fa91ffb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import org.apache.spark.sql.types.DoubleType

/**
* Evaluator for multiclass classification, which expects input columns: prediction, label,
* weight(optional) and probability(only for logLoss).
* weight (optional) and probability (only for logLoss).
*/
@Since("1.5.0")
class MulticlassClassificationEvaluator @Since("1.5.0") (@Since("1.5.0") override val uid: String)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ class MulticlassMetrics @Since("1.1.0") (predictionAndLabels: RDD[_ <: Product])

/**
* An auxiliary constructor taking a DataFrame.
* @param predictionAndLabels a DataFrame with columns: prediction, label, weight(optional)
* and probability(only for logLoss)
* @param predictionAndLabels a DataFrame with columns: prediction, label, weight (optional)
* and probability (only for logLoss)
*/
private[mllib] def this(predictionAndLabels: DataFrame) =
this(predictionAndLabels.rdd.map { r =>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

matching will not work in pyspark, so I have to use r.get instead.
MultilabelMetrics also deals with dataframe in this way.

Expand Down
2 changes: 1 addition & 1 deletion python/pyspark/ml/evaluation.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ class MulticlassClassificationEvaluator(JavaEvaluator, HasLabelCol, HasPredictio
HasProbabilityCol, JavaMLReadable, JavaMLWritable):
"""
Evaluator for Multiclass Classification, which expects input
columns: prediction, label, weight(optional) and probabilityCol(only for logLoss).
columns: prediction, label, weight (optional) and probabilityCol (only for logLoss).

>>> scoreAndLabels = [(0.0, 0.0), (0.0, 1.0), (0.0, 0.0),
... (1.0, 0.0), (1.0, 1.0), (1.0, 1.0), (1.0, 1.0), (2.0, 2.0), (2.0, 0.0)]
Expand Down